From 011bab3c80ec7b7a853e2e4b89473618f07e693d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 5 Mar 2018 06:11:53 +0100 Subject: Add missing instructions to add external types to tsconfig.json after installing the package --- packages/0x.js/README.md | 9 +++++++++ packages/assert/README.md | 8 ++++++++ packages/base-contract/README.md | 9 +++++++++ packages/connect/README.md | 8 ++++++++ packages/dev-utils/README.md | 8 ++++++++ packages/subproviders/README.md | 8 ++++++++ packages/types/README.md | 8 ++++++++ packages/utils/README.md | 8 ++++++++ packages/web3-wrapper/README.md | 8 ++++++++ 9 files changed, 74 insertions(+) diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md index 18c771234..2d0394726 100644 --- a/packages/0x.js/README.md +++ b/packages/0x.js/README.md @@ -18,6 +18,15 @@ npm install 0x.js --save 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" +] +``` + #### UMD: **Install** diff --git a/packages/assert/README.md b/packages/assert/README.md index 59ab63e91..1ea6acfb5 100644 --- a/packages/assert/README.md +++ b/packages/assert/README.md @@ -8,6 +8,14 @@ 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 diff --git a/packages/base-contract/README.md b/packages/base-contract/README.md index ff0d4d303..fa2f3da10 100644 --- a/packages/base-contract/README.md +++ b/packages/base-contract/README.md @@ -8,6 +8,15 @@ BaseContract to derive all auto-generated wrappers from 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" +] +``` + ## Usage ```javascript diff --git a/packages/connect/README.md b/packages/connect/README.md index 7302322e6..393ea70a0 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -8,6 +8,14 @@ This repository contains a Javascript library that makes it easy to interact wit 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", +] +``` + ## Usage * [Docs](https://0xproject.com/docs/connect) diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index 5a8e71f2f..f7e30df1e 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -7,3 +7,11 @@ Dev utils to be shared across 0x projects and packages ```bash 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", +] +``` diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 39e4a46e7..67a6a92d2 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -10,6 +10,14 @@ We have written up a [Wiki](https://0xproject.com/wiki#Web3-Provider-Examples) a 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", +] +``` + ## Usage Simply import the subprovider you are interested in using: diff --git a/packages/types/README.md b/packages/types/README.md index d2fa33c8f..5101ee544 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -8,6 +8,14 @@ Typescript types shared across 0x projects and packages 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", +] +``` + ## Usage ```javascript diff --git a/packages/utils/README.md b/packages/utils/README.md index ffb0d0190..22de85f4a 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -8,6 +8,14 @@ Utils to be shared across 0x projects and packages 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", +] +``` + ## Usage ```javascript diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index 7ed66ca41..0d5defb1e 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -8,6 +8,14 @@ Wrapped version of web3 with a nicer interface that is used across 0x projects a 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", +] +``` + ## Usage ```typescript -- cgit v1.2.3 From 24b9df475c33f800eb68ac1d8885284abcadb2d0 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 5 Mar 2018 06:12:36 +0100 Subject: Add ethers typescript typings to 0x.js deps. The library works without this atm since another dep of 0x.js has it as a dep. But it's more robust to have it here. --- packages/0x.js/CHANGELOG.md | 4 ++++ packages/0x.js/package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index f0377160b..f1023ac71 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v0.33.1 - _March 5, 2018_ + + * Add missing EthersJs typescript typings as dependency + ## v0.33.0 - _March 4, 2018_ * Validate and lowercase all addresses in public methods (#373) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 18bf20ee3..b91e4aa3f 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -93,6 +93,7 @@ "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "ethers-contracts": "^2.2.1", + "ethers-typescript-typings": "^0.0.2", "js-sha3": "^0.7.0", "lodash": "^4.17.4", "uuid": "^3.1.0", -- cgit v1.2.3 From 2b014617486e757681b18aed88ff87824c2211fe Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 5 Mar 2018 06:17:19 +0100 Subject: Remove date for now --- packages/0x.js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index f1023ac71..976ae35b2 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## v0.33.1 - _March 5, 2018_ +## v0.33.1 - _TBD, 2018_ * Add missing EthersJs typescript typings as dependency -- cgit v1.2.3 From 2e1993017879ac7dab914ac8e8a96cffcd24fc8a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 5 Mar 2018 06:17:57 +0100 Subject: remove from devDeps --- packages/0x.js/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index b91e4aa3f..2196fa777 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -61,7 +61,6 @@ "copyfiles": "^1.2.0", "coveralls": "^3.0.0", "dirty-chai": "^2.0.1", - "ethers-typescript-typings": "^0.0.2", "json-loader": "^0.5.4", "mocha": "^4.0.1", "npm-run-all": "^4.1.2", -- cgit v1.2.3 From b4b664e97acd25b8a00c7fae3b6eacd9fbf74585 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Mar 2018 09:33:35 +0100 Subject: Fix source links in docs with a hack to support old and new versions of the TypeDoc JSON files --- packages/website/ts/pages/documentation/doc_page.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 2c8f1c103..85fd9bf33 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -13,6 +13,8 @@ import { constants } from 'ts/utils/constants'; import { docUtils } from 'ts/utils/doc_utils'; import { Translate } from 'ts/utils/translate'; +const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; + const docIdToS3BucketName: { [id: string]: string } = { [DocPackages.ZeroExJs]: '0xjs-docs-jsons', [DocPackages.SmartContracts]: 'smart-contracts-docs-json', @@ -120,13 +122,22 @@ export class DocPage extends React.Component { } private _getSourceUrl() { const url = this.props.docsInfo.packageUrl; - const pkg = docIdToSubpackageName[this.props.docsInfo.id]; + let pkg = docIdToSubpackageName[this.props.docsInfo.id]; let tagPrefix = pkg; const packagesWithNamespace = ['connect']; if (_.includes(packagesWithNamespace, pkg)) { tagPrefix = `@0xproject/${pkg}`; } - const sourceUrl = `${url}/blob/${tagPrefix}%40${this.props.docsVersion}/packages/${pkg}`; + // HACK: The following three lines exist for backward compatibility reasons + // Before exporting types from other packages as part of the 0x.js interface, + // all TypeDoc generated paths omitted the topLevel `0x.js` segment. Now it + // adds it, and for that reason, we need to make sure we don't add it twice in + // the source links we generate. + const semvers = semverSort.desc([this.props.docsVersion, ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH]); + const isVersionAfterTopLevelPathChange = semvers[0] !== ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH; + pkg = this.props.docsInfo.id === DocPackages.ZeroExJs && isVersionAfterTopLevelPathChange ? '' : `/${pkg}`; + + const sourceUrl = `${url}/blob/${tagPrefix}%40${this.props.docsVersion}/packages${pkg}`; return sourceUrl; } } -- cgit v1.2.3 From 5dd065410517f511b2e087dcd91839526bac95b5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Mar 2018 09:34:22 +0100 Subject: Also show staging 0x.js docs on development --- packages/website/ts/pages/documentation/doc_page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 85fd9bf33..098df5bfd 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -15,11 +15,11 @@ import { Translate } from 'ts/utils/translate'; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; +const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; const docIdToS3BucketName: { [id: string]: string } = { - [DocPackages.ZeroExJs]: '0xjs-docs-jsons', + [DocPackages.ZeroExJs]: isDevelopment ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons', [DocPackages.SmartContracts]: 'smart-contracts-docs-json', - [DocPackages.Connect]: - configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-connect-docs-jsons' : 'connect-docs-jsons', + [DocPackages.Connect]: isDevelopment ? 'staging-connect-docs-jsons' : 'connect-docs-jsons', }; const docIdToSubpackageName: { [id: string]: string } = { -- cgit v1.2.3