diff options
Diffstat (limited to 'packages')
96 files changed, 223 insertions, 538 deletions
diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md index 2d0394726..5b17dac8b 100644 --- a/packages/0x.js/README.md +++ b/packages/0x.js/README.md @@ -20,11 +20,10 @@ import { ZeroEx } from '0x.js'; If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", - "./node_modules/ethers-typescript-typings/index.d.ts" -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` #### UMD: diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 5f5b32aac..49d96235c 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -68,9 +68,7 @@ "awesome-typescript-loader": "^3.1.3", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", "chai-bignumber": "^2.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "json-loader": "^0.5.4", @@ -99,18 +97,17 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "bintrees": "^1.0.2", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "js-sha3": "^0.7.0", "lodash": "^4.17.4", "uuid": "^3.1.0", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index d61847d1d..8ba2e53f7 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -216,7 +216,7 @@ describe('ZeroEx library', () => { s: '0x050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb02', }; stubs = [ - Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)), + Sinon.stub((zeroEx as any)._web3Wrapper, 'signMessageAsync').returns(Promise.resolve(signature)), Sinon.stub(ZeroEx, 'isValidSignature').returns(true), ]; diff --git a/packages/0x.js/tsconfig.json b/packages/0x.js/tsconfig.json index a6b5c71c2..ddf5a910e 100644 --- a/packages/0x.js/tsconfig.json +++ b/packages/0x.js/tsconfig.json @@ -8,10 +8,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index fc1adeb06..2fdf19320 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -45,8 +46,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "tslint": "5.8.0", - "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2" + "typescript": "2.7.1" }, "publishConfig": { "access": "public" diff --git a/packages/abi-gen/tsconfig.json b/packages/abi-gen/tsconfig.json index 5e0c7c6d3..e35816553 100644 --- a/packages/abi-gen/tsconfig.json +++ b/packages/abi-gen/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/assert/README.md b/packages/assert/README.md index 1ea6acfb5..7f80e7e5d 100644 --- a/packages/assert/README.md +++ b/packages/assert/README.md @@ -8,14 +8,6 @@ Standard type and schema assertions to be used across all 0x projects and packag yarn add @0xproject/assert ``` -If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: - -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] -``` - ## Usage ```typescript @@ -24,6 +16,14 @@ import { assert } from '@0xproject/assert'; assert.isValidBaseUnitAmount('baseUnitAmount', baseUnitAmount); ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/assert/package.json b/packages/assert/package.json index 73b3b7f37..3df7eab8d 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -32,7 +32,6 @@ "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", @@ -45,6 +44,7 @@ "dependencies": { "@0xproject/json-schemas": "^0.7.17", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "lodash": "^4.17.4", "valid-url": "^1.0.9" }, diff --git a/packages/assert/tsconfig.json b/packages/assert/tsconfig.json index 10354fa33..e35816553 100644 --- a/packages/assert/tsconfig.json +++ b/packages/assert/tsconfig.json @@ -3,10 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/base-contract/README.md b/packages/base-contract/README.md index fa2f3da10..a689d0130 100644 --- a/packages/base-contract/README.md +++ b/packages/base-contract/README.md @@ -10,11 +10,10 @@ yarn add @0xproject/base-contract If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", - "./node_modules/ethers-typescript-typings/index.d.ts" -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index 4e0260417..554f0a41c 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -32,11 +32,10 @@ "dependencies": { "@0xproject/types": "^0.4.1", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/base-contract/tsconfig.json b/packages/base-contract/tsconfig.json index 8114d99cd..c56d255d5 100644 --- a/packages/base-contract/tsconfig.json +++ b/packages/base-contract/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/chai-as-promised-typescript-typings/README.md b/packages/chai-as-promised-typescript-typings/README.md deleted file mode 100644 index 72784ef53..000000000 --- a/packages/chai-as-promised-typescript-typings/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## chai-as-promised-typescript-typings - -Fork of type definitions for chai-as-promised that includes changes made by dirty-chai - -## Installation - -```bash -yarn add -D chai-as-promised-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/chai-as-promised-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/chai-typescript-typings/.npmignore b/packages/chai-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/chai-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/chai-typescript-typings/CHANGELOG.md b/packages/chai-typescript-typings/CHANGELOG.md deleted file mode 100644 index 8c52570da..000000000 --- a/packages/chai-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# CHANGELOG - -## v0.x.x - _TBD, 2018_ diff --git a/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts b/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts b/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/chai-typescript-typings/package.json b/packages/chai-typescript-typings/package.json deleted file mode 100644 index 96b58cce3..000000000 --- a/packages/chai-typescript-typings/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "chai-typescript-typings", - "version": "0.0.6", - "description": "Typescript type definitions for chai", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/chai-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "copyfiles": "^1.2.0", - "shx": "^0.2.2" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/chai-typescript-typings/tsconfig.json b/packages/chai-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/chai-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/chai-typescript-typings/tslint.json b/packages/chai-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/chai-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/connect/README.md b/packages/connect/README.md index 393ea70a0..7087214d6 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -10,10 +10,10 @@ yarn add @0xproject/connect If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/connect/package.json b/packages/connect/package.json index ae243f288..3e9f3053c 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -53,6 +53,7 @@ "@0xproject/json-schemas": "^0.7.17", "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", "query-string": "^5.0.1", @@ -69,8 +70,6 @@ "async-child-process": "^1.1.1", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "fetch-mock": "^5.13.1", @@ -80,8 +79,7 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typedoc": "~0.8.0", - "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2" + "typescript": "2.7.1" }, "publishConfig": { "access": "public" diff --git a/packages/connect/tsconfig.json b/packages/connect/tsconfig.json index fd9e604ad..e35816553 100644 --- a/packages/connect/tsconfig.json +++ b/packages/connect/tsconfig.json @@ -3,11 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 377fba473..0c931344d 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -49,12 +49,9 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", "chai-bignumber": "^2.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", - "ethers-typescript-typings": "^0.0.4", "mocha": "^4.0.1", "npm-run-all": "^4.1.2", "prettier": "^1.11.1", @@ -64,7 +61,6 @@ "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "yargs": "^10.0.3" }, "dependencies": { @@ -74,6 +70,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "bluebird": "^3.5.0", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", diff --git a/packages/contracts/tsconfig.json b/packages/contracts/tsconfig.json index 490531eeb..f32a3682a 100644 --- a/packages/contracts/tsconfig.json +++ b/packages/contracts/tsconfig.json @@ -9,11 +9,6 @@ }, "include": [ "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", "../../node_modules/types-bn/index.d.ts", "./globals.d.ts", "./src/**/*", diff --git a/packages/deployer/README.md b/packages/deployer/README.md index 8fe82f59e..812e8c31b 100644 --- a/packages/deployer/README.md +++ b/packages/deployer/README.md @@ -18,6 +18,14 @@ yarn global add @0xproject/deployer yarn add @0xproject/deployer ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + **Import** ```typescript diff --git a/packages/deployer/package.json b/packages/deployer/package.json index a8b847cd0..362bc659e 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -53,7 +53,6 @@ "chai": "^4.0.1", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", - "ethers-typescript-typings": "^0.0.4", "mocha": "^4.0.1", "nyc": "^11.0.1", "shx": "^0.2.2", @@ -68,6 +67,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", diff --git a/packages/deployer/tsconfig.json b/packages/deployer/tsconfig.json index befcde5b7..a4cbc37c5 100644 --- a/packages/deployer/tsconfig.json +++ b/packages/deployer/tsconfig.json @@ -8,9 +8,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index 0c4175e35..d7e580d9f 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -21,8 +21,8 @@ yarn add @0xproject/dev-utils If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index de18f4354..71c1615e8 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -30,7 +30,6 @@ "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "mocha": "^4.0.1", "npm-run-all": "^4.1.2", @@ -47,6 +46,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.2", "lodash": "^4.17.4", "request-promise-native": "^1.0.5", diff --git a/packages/dev-utils/tsconfig.json b/packages/dev-utils/tsconfig.json index 1ed3fbc9c..7b93af0da 100644 --- a/packages/dev-utils/tsconfig.json +++ b/packages/dev-utils/tsconfig.json @@ -7,9 +7,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/ethers-typescript-typings/.npmignore b/packages/ethers-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/ethers-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/ethers-typescript-typings/CHANGELOG.md b/packages/ethers-typescript-typings/CHANGELOG.md deleted file mode 100644 index 00bf165a4..000000000 --- a/packages/ethers-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# CHANGELOG - -## v0.0.2 - _March 4, 2018_ - - * Initial types (#413) diff --git a/packages/ethers-typescript-typings/README.md b/packages/ethers-typescript-typings/README.md deleted file mode 100644 index 56ce5f138..000000000 --- a/packages/ethers-typescript-typings/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## ethers-typescript-typings - -There currently isn't an official [Ethers][ethers] -type definition included in the [DefinitelyTyped][definitelytyped] project. -Until that happens, we will continue to improve our own type definition. -If it get's close to comprehensive, we'll add it to [DefinitelyTyped][definitelytyped]. - -[ethers]: https://github.com/ethers-io/ethers.js -[definitelytyped]: https://github.com/DefinitelyTyped/DefinitelyTyped - -## Installation - -```bash -yarn add -D ethers-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/ethers-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts b/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts b/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/ethers-typescript-typings/package.json b/packages/ethers-typescript-typings/package.json deleted file mode 100644 index d797033e1..000000000 --- a/packages/ethers-typescript-typings/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "ethers-typescript-typings", - "version": "0.0.4", - "description": "Typescript type definitions for ethers.js", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "lint": "tslint index.d.ts", - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "author": "Fabio Berger", - "contributors": [ - "Leonid Logvinov <logvinov.leon@gmail.com>" - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/ethers-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "copyfiles": "^1.2.0", - "shx": "^0.2.2", - "tslint": "5.8.0", - "tslint-config-0xproject": "^0.0.2", - "typescript": "2.7.1" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/ethers-typescript-typings/tsconfig.json b/packages/ethers-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/ethers-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/ethers-typescript-typings/tslint.json b/packages/ethers-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/ethers-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md index f320196e9..980d17416 100644 --- a/packages/json-schemas/README.md +++ b/packages/json-schemas/README.md @@ -12,8 +12,8 @@ yarn add @0xproject/json-schemas **Import** -```javascript -import { schemas } from '@0xproject/json-schemas'; +```typescript +import { SchemaValidator, ValidatorResult, schemas } from '@0xproject/json-schemas'; ``` or @@ -22,6 +22,14 @@ or var schemas = require('@0xproject/json-schemas').schemas; ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 1266f964b..f4f4c63b5 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -39,6 +39,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { + "@0xproject/typescript-typings": "^0.0.1", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, @@ -50,7 +51,6 @@ "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "lodash.foreach": "^4.5.0", diff --git a/packages/json-schemas/tsconfig.json b/packages/json-schemas/tsconfig.json index 10354fa33..e35816553 100644 --- a/packages/json-schemas/tsconfig.json +++ b/packages/json-schemas/tsconfig.json @@ -3,10 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index a8f4918ca..5333e6cad 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -25,6 +25,8 @@ "@0xproject/tslint-config": "0.4.8", "@types/glob": "^5.0.33", "@types/node": "^8.0.53", + "@types/rimraf": "^2.0.2", + "lerna-get-packages": "^1.0.0", "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "2.7.1" @@ -35,7 +37,9 @@ "es6-promisify": "^5.0.0", "glob": "^7.1.2", "lodash": "^4.17.4", + "promisify-child-process": "^1.0.5", "publish-release": "0xproject/publish-release", + "rimraf": "^2.6.2", "semver-sort": "^0.0.4" }, "publishConfig": { diff --git a/packages/monorepo-scripts/src/globals.d.ts b/packages/monorepo-scripts/src/globals.d.ts index 757ae4097..1d49559f2 100644 --- a/packages/monorepo-scripts/src/globals.d.ts +++ b/packages/monorepo-scripts/src/globals.d.ts @@ -6,3 +6,22 @@ declare module 'es6-promisify'; declare module 'semver-sort' { const desc: (versions: string[]) => string[]; } + +declare interface LernaPackage { + location: string; + package: { + private?: boolean; + name: string; + main?: string; + config?: { + additionalTsTypings?: string[]; + }; + }; +} +declare function lernaGetPackages(path: string): LernaPackage[]; +// lerna-get-packages declarations +declare module 'lerna-get-packages' { + export = lernaGetPackages; +} + +declare module 'promisify-child-process'; diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts new file mode 100644 index 000000000..195b64b2a --- /dev/null +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -0,0 +1,58 @@ +#!/usr/bin/env node + +import * as fs from 'fs'; +import lernaGetPackages = require('lerna-get-packages'); +import * as _ from 'lodash'; +import * as path from 'path'; +import { exec as execAsync } from 'promisify-child-process'; +import * as rimraf from 'rimraf'; + +import { utils } from './utils'; + +(async () => { + const monorepoRootPath = path.join(__dirname, '../../..'); + const lernaPackages = lernaGetPackages(monorepoRootPath); + const installablePackages = _.filter( + lernaPackages, + lernaPackage => + !lernaPackage.package.private && + !_.isUndefined(lernaPackage.package.main) && + lernaPackage.package.main.endsWith('.js'), + ); + for (const installableLernaPackage of installablePackages) { + const packagePath = installableLernaPackage.location; + const packageName = installableLernaPackage.package.name; + utils.log(`Testing ${packageName}`); + let result = await execAsync('npm pack', { cwd: packagePath }); + const packedPackageFileName = result.stdout.trim(); + const testDirectory = path.join(monorepoRootPath, '../test-env'); + fs.mkdirSync(testDirectory); + result = await execAsync('yarn init --yes', { cwd: testDirectory }); + utils.log(`Installing ${packedPackageFileName}`); + result = await execAsync(`yarn add ${packagePath}/${packedPackageFileName}`, { cwd: testDirectory }); + const indexFilePath = path.join(testDirectory, 'index.ts'); + fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}'`); + const tsConfig = { + compilerOptions: { + typeRoots: ['node_modules/@0xproject/typescript-typings/types', 'node_modules/@types'], + module: 'commonjs', + target: 'es5', + lib: ['es2017', 'dom'], + declaration: true, + noImplicitReturns: true, + pretty: true, + strict: true, + }, + include: ['index.ts'], + }; + const tsconfigFilePath = path.join(testDirectory, 'tsconfig.json'); + fs.writeFileSync(tsconfigFilePath, JSON.stringify(tsConfig, null, 4)); + utils.log(`Compiling ${packageName}`); + await execAsync('../node_modules/typescript/bin/tsc', { cwd: testDirectory }); + utils.log(`Successfully compiled with ${packageName} as a dependency`); + rimraf.sync(testDirectory); + } +})().catch(err => { + utils.log(err.stdout); + process.exit(1); +}); diff --git a/packages/monorepo-scripts/tsconfig.json b/packages/monorepo-scripts/tsconfig.json index 3d967d05f..c56d255d5 100644 --- a/packages/monorepo-scripts/tsconfig.json +++ b/packages/monorepo-scripts/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index 2dce1a0eb..25fa1ecd2 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -27,8 +27,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-tap-event-plugin": "0.0.30", "awesome-typescript-loader": "^3.1.3", "copyfiles": "^1.2.0", diff --git a/packages/react-docs/README.md b/packages/react-docs/README.md index cad05ca67..9be370f10 100644 --- a/packages/react-docs/README.md +++ b/packages/react-docs/README.md @@ -33,6 +33,14 @@ This package exposes both a single `Documentation` react component that will ren Currently this package still has some external dependencies outside of the `Documentation` component, so please start your project off by copying the [react-docs-example](https://github.com/0xProject/0x-monorepo/tree/development/packages/react-docs-example) directory and modifying it there. If you need changes in the [react-docs](https://github.com/0xProject/0x-monorepo/tree/development/packages/react-docs) package, fork the 0x monorepo, make the required changes and submit a PR. Until we merge it, you can have your project depend on your own custom fork. +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Future improvements Feel free to contribute to these improvements! diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index ebc445d98..0b0a52efa 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -35,8 +35,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-scroll": "0.0.31", "@types/react-tap-event-plugin": "0.0.30", "basscss": "^8.0.3", diff --git a/packages/react-docs/tsconfig.json b/packages/react-docs/tsconfig.json index 9af6638a2..82f44a62c 100644 --- a/packages/react-docs/tsconfig.json +++ b/packages/react-docs/tsconfig.json @@ -9,5 +9,5 @@ "*": ["node_modules/@types/*", "*"] } }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/react-shared/README.md b/packages/react-shared/README.md index da7ff83af..9165cf78d 100644 --- a/packages/react-shared/README.md +++ b/packages/react-shared/README.md @@ -8,6 +8,14 @@ Contains React components & frontend types/utils shared between 0x projects. yarn add @0xproject/react-shared ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index e5201536e..8b7a0ebbb 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -33,8 +33,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-scroll": "0.0.31", "basscss": "^8.0.3", "is-mobile": "^0.2.2", diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 106c47d13..6b5183ff2 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -40,6 +40,7 @@ "dependencies": { "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.3.4", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -57,7 +58,6 @@ "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/sol-cov/tsconfig.json b/packages/sol-cov/tsconfig.json index 44e43719b..7b93af0da 100644 --- a/packages/sol-cov/tsconfig.json +++ b/packages/sol-cov/tsconfig.json @@ -7,8 +7,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 78c37e002..d8cbea70e 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -33,6 +33,7 @@ "@0xproject/connect": "^0.6.6", "@0xproject/json-schemas": "^0.7.17", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "chalk": "^2.3.0", "lodash": "^4.17.4", "newman": "^3.9.3", @@ -48,8 +49,6 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.10", - "chai-typescript-typings": "^0.0.4", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/sra-report/tsconfig.json b/packages/sra-report/tsconfig.json index a0a54410a..e35816553 100644 --- a/packages/sra-report/tsconfig.json +++ b/packages/sra-report/tsconfig.json @@ -3,12 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index a2bf75768..ac92b89d2 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -14,10 +14,10 @@ yarn add @0xproject/subproviders If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Contributing diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 96d3e7f00..411fe22dc 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -36,6 +36,7 @@ "@0xproject/assert": "^0.2.3", "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "^4.3.0", "bn.js": "^4.11.8", @@ -47,8 +48,7 @@ "lodash": "^4.17.4", "semaphore-async-await": "^1.5.1", "web3": "^0.20.0", - "web3-provider-engine": "^13.0.1", - "web3-typescript-typings": "^0.10.2" + "web3-provider-engine": "^13.0.1" }, "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.14", @@ -59,8 +59,6 @@ "@types/node": "^8.0.53", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/subproviders/tsconfig.json b/packages/subproviders/tsconfig.json index 9a65a0a97..7b93af0da 100644 --- a/packages/subproviders/tsconfig.json +++ b/packages/subproviders/tsconfig.json @@ -6,10 +6,7 @@ "include": [ "./src/**/*", "./test/**/*", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index 7159af988..7b43db4e7 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -18,6 +18,7 @@ "0x.js": "^0.33.6", "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", @@ -41,7 +42,6 @@ "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "webpack": "^3.1.0", "webpack-node-externals": "^1.6.0" } diff --git a/packages/testnet-faucets/tsconfig.json b/packages/testnet-faucets/tsconfig.json index 237f62169..b0e7ba00c 100644 --- a/packages/testnet-faucets/tsconfig.json +++ b/packages/testnet-faucets/tsconfig.json @@ -6,9 +6,7 @@ }, "include": [ "./src/ts/**/*", - "../../node_modules/ethers-typescript-typings/index.d.ts", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/tslint-config/tsconfig.json b/packages/tslint-config/tsconfig.json index 6e5f060a4..85c88035a 100644 --- a/packages/tslint-config/tsconfig.json +++ b/packages/tslint-config/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./rules/**/*", "./monorepo_scripts/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./rules/**/*", "./monorepo_scripts/**/*"] } diff --git a/packages/types/README.md b/packages/types/README.md index 5101ee544..b971eaee7 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -10,10 +10,10 @@ yarn add -D @0xproject/types If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/types/package.json b/packages/types/package.json index e664b06ae..1142d252a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,9 +28,9 @@ "typescript": "2.7.1" }, "dependencies": { + "@0xproject/typescript-typings": "^0.0.1", "bignumber.js": "~4.1.0", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 3d967d05f..c56d255d5 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/chai-as-promised-typescript-typings/.npmignore b/packages/typescript-typings/.npmignore index 104d718ed..104d718ed 100644 --- a/packages/chai-as-promised-typescript-typings/.npmignore +++ b/packages/typescript-typings/.npmignore diff --git a/packages/chai-as-promised-typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md index 8c52570da..8c52570da 100644 --- a/packages/chai-as-promised-typescript-typings/CHANGELOG.md +++ b/packages/typescript-typings/CHANGELOG.md diff --git a/packages/chai-typescript-typings/README.md b/packages/typescript-typings/README.md index 9bd0574d1..9a74739f3 100644 --- a/packages/chai-typescript-typings/README.md +++ b/packages/typescript-typings/README.md @@ -1,21 +1,23 @@ -## chai-typescript-typings +## @0xproject/typescript-typings -Fork of type definitions for chai that includes changes made by dirty-chai +Type repository for external packages used by 0x. This is like our small version of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) ## Installation ```bash -yarn add -D chai-typescript-typings +yarn add -D @0xproject/typescript-typings ``` ## Usage -Add the following line within an `include` section of your `tsconfig.json` +Add the following line within an `compilerOptions` section of your `tsconfig.json` ```json -"./node_modules/chai-typescript-typings/index.d.ts" +"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"] ``` +This will allow the TS compiler to first look into that repo and then fallback to DT types. + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts b/packages/typescript-typings/monorepo_scripts/globals.d.ts index 94e63a32d..94e63a32d 100644 --- a/packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts +++ b/packages/typescript-typings/monorepo_scripts/globals.d.ts diff --git a/packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts b/packages/typescript-typings/monorepo_scripts/postpublish.ts index dcb99d0f7..dcb99d0f7 100644 --- a/packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts +++ b/packages/typescript-typings/monorepo_scripts/postpublish.ts diff --git a/packages/chai-as-promised-typescript-typings/package.json b/packages/typescript-typings/package.json index cbf2630ec..8fce84272 100644 --- a/packages/chai-as-promised-typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -1,9 +1,7 @@ { - "name": "chai-as-promised-typescript-typings", - "version": "0.0.12", - "description": "Typescript type definitions for chai-as-promised", - "main": "index.d.ts", - "types": "index.d.ts", + "name": "@0xproject/typescript-typings", + "version": "0.0.1", + "description": "0x project typescript type definitions", "scripts": { "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", "clean": "shx rm -rf scripts" @@ -20,9 +18,9 @@ "bugs": { "url": "https://github.com/0xProject/0x-monorepo/issues" }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/chai-as-promised-typescript-typings#readme", + "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { - "chai-typescript-typings": "^0.0.6" + "bignumber.js": "~4.1.0" }, "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.14", diff --git a/packages/chai-as-promised-typescript-typings/tsconfig.json b/packages/typescript-typings/tsconfig.json index bc453af4b..bc453af4b 100644 --- a/packages/chai-as-promised-typescript-typings/tsconfig.json +++ b/packages/typescript-typings/tsconfig.json diff --git a/packages/chai-as-promised-typescript-typings/tslint.json b/packages/typescript-typings/tslint.json index 9a93a1f74..9a93a1f74 100644 --- a/packages/chai-as-promised-typescript-typings/tslint.json +++ b/packages/typescript-typings/tslint.json diff --git a/packages/chai-as-promised-typescript-typings/index.d.ts b/packages/typescript-typings/types/chai-as-promised/index.d.ts index ba6dabdcc..ba6dabdcc 100644 --- a/packages/chai-as-promised-typescript-typings/index.d.ts +++ b/packages/typescript-typings/types/chai-as-promised/index.d.ts diff --git a/packages/chai-typescript-typings/index.d.ts b/packages/typescript-typings/types/chai/index.d.ts index 8b3e4c079..8b3e4c079 100644 --- a/packages/chai-typescript-typings/index.d.ts +++ b/packages/typescript-typings/types/chai/index.d.ts diff --git a/packages/ethers-typescript-typings/index.d.ts b/packages/typescript-typings/types/ethers-contracts/index.d.ts index e5d38819e..e5d38819e 100644 --- a/packages/ethers-typescript-typings/index.d.ts +++ b/packages/typescript-typings/types/ethers-contracts/index.d.ts diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/typescript-typings/types/web3/index.d.ts index cbe067b37..cbe067b37 100644 --- a/packages/web3-typescript-typings/index.d.ts +++ b/packages/typescript-typings/types/web3/index.d.ts diff --git a/packages/utils/README.md b/packages/utils/README.md index 22de85f4a..fde0780a9 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -10,10 +10,10 @@ yarn add @0xproject/utils If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/utils/package.json b/packages/utils/package.json index ffdd7fe2e..bc869fe1e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -31,14 +31,13 @@ }, "dependencies": { "@0xproject/types": "^0.4.1", + "@0xproject/typescript-typings": "^0.0.1", "@types/node": "^8.0.53", "bignumber.js": "~4.1.0", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "js-sha3": "^0.7.0", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 8114d99cd..c56d255d5 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/web3-typescript-typings/.npmignore b/packages/web3-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/web3-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/web3-typescript-typings/CHANGELOG.md b/packages/web3-typescript-typings/CHANGELOG.md deleted file mode 100644 index 845b1ecd2..000000000 --- a/packages/web3-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# CHANGELOG - -## v0.10.0 - _March 4, 2018_ - - * Support ABIv2 (#401) - * Add types for transaction traces (#426) - -## v0.9.11 - _February 16, 2018_ - - * Fix `web3.net.peerCount` to be of type number instead of boolean (#397) - -## v0.9.3 - _January 11, 2018_ - - * Fix `getTransactionReceipt` not returning null (#338) - * Add type for getData on a contract - * Fixed the `defaultAccount` not allowing for `undefined` value (#320) diff --git a/packages/web3-typescript-typings/README.md b/packages/web3-typescript-typings/README.md deleted file mode 100644 index 95c193287..000000000 --- a/packages/web3-typescript-typings/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## web3-typescript-typings - -There currently isn't an official [Web3][web3] -type definition included in the [DefinitelyTyped][definitelytyped] project. -Until that happens, we will continue to improve our own type definition. -If it get's close to comprehensive, we'll add it to [DefinitelyTyped][definitelytyped]. - -[web3]: https://github.com/ethereum/web3.js/ -[definitelytyped]: https://github.com/DefinitelyTyped/DefinitelyTyped - -## Installation - -```bash -yarn add -D web3-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/web3-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts b/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts b/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/web3-typescript-typings/package.json b/packages/web3-typescript-typings/package.json deleted file mode 100644 index d56b83421..000000000 --- a/packages/web3-typescript-typings/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "web3-typescript-typings", - "version": "0.10.2", - "description": "Typescript type definitions for web3", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "lint": "tslint index.d.ts", - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "author": "Fabio Berger", - "contributors": [ - "Leonid Logvinov <logvinov.leon@gmail.com>" - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "@types/bignumber.js": "^4.0.2", - "copyfiles": "^1.2.0", - "shx": "^0.2.2", - "tslint": "5.8.0", - "tslint-config-0xproject": "^0.0.2", - "typescript": "2.7.1" - }, - "dependencies": { - "bignumber.js": "~4.1.0" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/web3-typescript-typings/tsconfig.json b/packages/web3-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/web3-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/web3-typescript-typings/tslint.json b/packages/web3-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/web3-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index 1fed11407..e7491acb0 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -12,10 +12,10 @@ yarn add @0xproject/web3-wrapper If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Contributing diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 176f796c8..fa79fa377 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -45,11 +45,10 @@ "dependencies": { "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/web3-wrapper/tsconfig.json b/packages/web3-wrapper/tsconfig.json index 7bae7f9f0..c56d255d5 100644 --- a/packages/web3-wrapper/tsconfig.json +++ b/packages/web3-wrapper/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/website/package.json b/packages/website/package.json index c455306ee..3869fb040 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -24,6 +24,7 @@ "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", @@ -75,9 +76,9 @@ "@types/moment": "^2.13.0", "@types/node": "^8.0.53", "@types/query-string": "^5.0.1", - "@types/react": "^15.0.15", + "@types/react": "^16.0.34", "@types/react-copy-to-clipboard": "^4.2.0", - "@types/react-dom": "^0.14.23", + "@types/react-dom": "^16.0.3", "@types/react-redux": "^4.4.37", "@types/react-router-dom": "^4.0.4", "@types/react-scroll": "0.0.31", @@ -87,7 +88,6 @@ "copy-webpack-plugin": "^4.0.1", "copyfiles": "^1.2.0", "css-loader": "0.23.x", - "ethers-typescript-typings": "^0.0.4", "exports-loader": "0.6.x", "imports-loader": "0.6.x", "json-loader": "^0.5.4", @@ -99,7 +99,6 @@ "tslint": "5.8.0", "tslint-config-0xproject": "^0.0.2", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "webpack": "^3.1.0", "webpack-dev-middleware": "^1.10.0", "webpack-dev-server": "^2.5.0" diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx index d1bdb447f..42ca1713d 100644 --- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx +++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx @@ -37,8 +37,8 @@ export class EthWethConversionDialog extends React.Component< EthWethConversionDialogState > { private _isUnmounted: boolean; - constructor() { - super(); + constructor(props: EthWethConversionDialogProps) { + super(props); this._isUnmounted = false; this.state = { shouldShowIncompleteErrs: false, diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx index d44dd9aab..2af7fd7ac 100644 --- a/packages/website/ts/components/dialogs/send_dialog.tsx +++ b/packages/website/ts/components/dialogs/send_dialog.tsx @@ -27,8 +27,8 @@ interface SendDialogState { } export class SendDialog extends React.Component<SendDialogProps, SendDialogState> { - constructor() { - super(); + constructor(props: SendDialogProps) { + super(props); this.state = { recipient: '', shouldShowIncompleteErrs: false, diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx index 957ed2044..6c0186ac0 100644 --- a/packages/website/ts/components/footer.tsx +++ b/packages/website/ts/components/footer.tsx @@ -45,7 +45,7 @@ interface FooterState { export class Footer extends React.Component<FooterProps, FooterState> { constructor(props: FooterProps) { - super(); + super(props); this.state = { selectedLanguage: props.translate.getLanguage(), }; diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index 99f465bc2..34171b51e 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -13,9 +13,5 @@ "*": ["node_modules/@types/*", "*"] } }, - "include": [ - "./ts/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./ts/**/*"] } |