From 34df5af2955079dadd7d63c67a3f93cc82adbff3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 17:46:24 +0200 Subject: Don't export object literal because the docs cannot yet render them, moved type to types file --- packages/web3-wrapper/CHANGELOG.json | 3 +++ packages/web3-wrapper/src/index.ts | 4 ++-- packages/web3-wrapper/src/types.ts | 6 ++++++ packages/web3-wrapper/src/web3_wrapper.ts | 10 ++-------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 846e8320e..ae35c874d 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -9,6 +9,9 @@ { "note": "Add `getNodeTypeAsync` method", "pr": 812 + }, + { + "notes": "Stop exporting uniqueVersionIds object" } ] }, diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index 19fe0836c..4433b4b54 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -1,3 +1,3 @@ -export { Web3Wrapper, uniqueVersionIds, NodeType } from './web3_wrapper'; -export { Web3WrapperErrors } from './types'; +export { Web3Wrapper } from './web3_wrapper'; +export { Web3WrapperErrors, NodeType } from './types'; export { marshaller } from './marshaller'; diff --git a/packages/web3-wrapper/src/types.ts b/packages/web3-wrapper/src/types.ts index b7b6bd68a..e81039186 100644 --- a/packages/web3-wrapper/src/types.ts +++ b/packages/web3-wrapper/src/types.ts @@ -57,3 +57,9 @@ export interface TxDataRPC extends CallTxDataBaseRPC { export interface CallDataRPC extends CallTxDataBaseRPC { from?: string; } + +// NodeType represents the type of the backing Ethereum node. +export enum NodeType { + Geth = 'GETH', + Ganache = 'GANACHE', +} diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index e828708f0..4439eb284 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -22,24 +22,18 @@ import { import * as _ from 'lodash'; import { marshaller } from './marshaller'; -import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, Web3WrapperErrors } from './types'; +import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types'; import { utils } from './utils'; const BASE_TEN = 10; // These are unique identifiers contained in the response of the // web3_clientVersion call. -export const uniqueVersionIds = { +const uniqueVersionIds = { geth: 'Geth', ganache: 'EthereumJS TestRPC', }; -// NodeType represents the type of the backing Ethereum node. -export enum NodeType { - Geth = 'GETH', - Ganache = 'GANACHE', -} - /** * An alternative to the Web3.js library that provides a consistent, clean, promise-based interface. */ -- cgit From cc223b9eaba4710767227644d2db63298a6b8ecb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 19:01:25 +0200 Subject: Compare host rather then origin so that it comes without the http/https prefix --- packages/website/ts/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index e656d5963..439af5e4b 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -334,7 +334,7 @@ export const utils = { return utils.isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL; }, isDevelopment(): boolean { - return _.includes(configs.DOMAINS_DEVELOPMENT, window.location.origin); + return _.includes(configs.DOMAINS_DEVELOPMENT, window.location.host); }, isStaging(): boolean { return _.includes(window.location.href, configs.DOMAIN_STAGING); -- cgit From b72857cd8b8a391b340d2f09636b140bcfd73a31 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 20:45:00 +0200 Subject: Update doc md files for v2 packages --- packages/website/md/docs/0xjs/2.0.0/introduction.md | 3 +++ packages/website/md/docs/0xjs/2.0.0/versioning.md | 1 + packages/website/md/docs/json_schemas/1.0.0/introduction.md | 2 ++ packages/website/ts/containers/zero_ex_js_documentation.ts | 11 +++++++++++ 4 files changed, 17 insertions(+) create mode 100644 packages/website/md/docs/0xjs/2.0.0/introduction.md create mode 100644 packages/website/md/docs/0xjs/2.0.0/versioning.md diff --git a/packages/website/md/docs/0xjs/2.0.0/introduction.md b/packages/website/md/docs/0xjs/2.0.0/introduction.md new file mode 100644 index 000000000..b98aeef38 --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/introduction.md @@ -0,0 +1,3 @@ +**NOTE:** Release candidate versions are meant to work with V2 of 0x protocol. To interact with V1, select a 0.X version. + +Welcome to the [0x.js](https://github.com/0xProject/0x-monorepo) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any token adhering to the token standards supported by the protocol (currently ERC20 & ERC721). Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20/ERC721 token balance/allowance and much more. diff --git a/packages/website/md/docs/0xjs/2.0.0/versioning.md b/packages/website/md/docs/0xjs/2.0.0/versioning.md new file mode 100644 index 000000000..5fe66ad9a --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/versioning.md @@ -0,0 +1 @@ +Since v1.0, this package adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. We will publish with a major version bump for any breaking change to the public interface, use a minor version bump when introducing new features in a backwards-compatible way, and patch versions when introducing backwards-compatible bug fixes. Because of this, we recommend you import `0x.js` with a caret `^2.0.0` to take advantage of non-breaking bug fixes. diff --git a/packages/website/md/docs/json_schemas/1.0.0/introduction.md b/packages/website/md/docs/json_schemas/1.0.0/introduction.md index a27f4b521..cc777b1a8 100644 --- a/packages/website/md/docs/json_schemas/1.0.0/introduction.md +++ b/packages/website/md/docs/json_schemas/1.0.0/introduction.md @@ -1,3 +1,5 @@ +**NOTE:** Release candidate versions are meant to work with V2 of 0x protocol. To interact with V1, select a 0.X version. + Welcome to the [@0xproject/json-schemas](https://github.com/0xProject/0x-monorepo/tree/development/packages/json-schemas) documentation! This package provides JSON schemas for validating 0x Protocol & Standard Relayer API data structures. It provides both the raw JSON schemas and a schema validator class to interact with them from a JS project. If you are not using a Javascript-based language for your project, you can copy-paste the JSON schemas within this package and use them together with a [JSON Schema](http://json-schema.org/) implementation in your [language of choice](http://json-schema.org/implementations.html) (e.g Python, Haskell, Go, C, C++, Rust, Ruby, Scala, etc...). diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index 2fc08e923..6be54595d 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -15,6 +15,9 @@ const InstallationMarkdownV1 = require('md/docs/0xjs/1.0.0/installation'); const AsyncMarkdownV1 = require('md/docs/0xjs/1.0.0/async'); const ErrorsMarkdownV1 = require('md/docs/0xjs/1.0.0/errors'); const versioningMarkdownV1 = require('md/docs/0xjs/1.0.0/versioning'); + +const IntroMarkdownV2 = require('md/docs/0xjs/2.0.0/introduction'); +const versioningMarkdownV2 = require('md/docs/0xjs/2.0.0/versioning'); /* tslint:enable:no-var-requires */ const zeroExJsDocSections = { @@ -62,6 +65,14 @@ const docsInfoConfig: DocsInfoConfig = { [zeroExJsDocSections.errors]: ErrorsMarkdownV1, [zeroExJsDocSections.versioning]: versioningMarkdownV1, }, + '1.0.0-rc.1': { + [zeroExJsDocSections.introduction]: IntroMarkdownV2, + [zeroExJsDocSections.versioning]: versioningMarkdownV2, + // These are the same as for V1 + [zeroExJsDocSections.installation]: InstallationMarkdownV1, + [zeroExJsDocSections.async]: AsyncMarkdownV1, + [zeroExJsDocSections.errors]: ErrorsMarkdownV1, + }, }, sectionNameToModulePath: { [zeroExJsDocSections.zeroEx]: ['"0x.js/src/0x"', '"src/0x"'], -- cgit From e53e2ac31befb850045430ff610e1cee7c446de7 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 20:45:20 +0200 Subject: Fix version dropdown so it also renders RC versions properly --- packages/website/ts/utils/doc_utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts index 1627b9b0c..b9084bba7 100644 --- a/packages/website/ts/utils/doc_utils.ts +++ b/packages/website/ts/utils/doc_utils.ts @@ -1,6 +1,5 @@ import { DoxityDocObj, TypeDocNode } from '@0xproject/react-docs'; import { fetchAsync, logUtils } from '@0xproject/utils'; -import findVersions = require('find-versions'); import * as _ from 'lodash'; import { S3FileObject, VersionToFilePath } from 'ts/types'; import convert = require('xml-js'); @@ -10,7 +9,7 @@ export const docUtils = { const versionFilePaths = await docUtils.getVersionFileNamesAsync(s3DocJsonRoot, folderName); const versionToFilePath: VersionToFilePath = {}; _.each(versionFilePaths, filePath => { - const [version] = findVersions(filePath); + const version = filePath.split('/v')[1].replace('.json', ''); versionToFilePath[version] = filePath; }); return versionToFilePath; -- cgit From c51f7a8375c970487a776f56edfc59f277144d44 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 20:51:33 +0200 Subject: Add PR nr. --- packages/web3-wrapper/CHANGELOG.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index ae35c874d..f69954bdc 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -11,7 +11,8 @@ "pr": 812 }, { - "notes": "Stop exporting uniqueVersionIds object" + "notes": "Stop exporting uniqueVersionIds object", + "pr": 897 } ] }, -- cgit From e5c5b36a73aad7a84e9540d905bc568997d12c5b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 19 Jul 2018 21:05:37 +0200 Subject: Specify exact version --- packages/website/md/docs/0xjs/2.0.0/versioning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/md/docs/0xjs/2.0.0/versioning.md b/packages/website/md/docs/0xjs/2.0.0/versioning.md index 5fe66ad9a..7f2b6fee9 100644 --- a/packages/website/md/docs/0xjs/2.0.0/versioning.md +++ b/packages/website/md/docs/0xjs/2.0.0/versioning.md @@ -1 +1 @@ -Since v1.0, this package adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. We will publish with a major version bump for any breaking change to the public interface, use a minor version bump when introducing new features in a backwards-compatible way, and patch versions when introducing backwards-compatible bug fixes. Because of this, we recommend you import `0x.js` with a caret `^2.0.0` to take advantage of non-breaking bug fixes. +Since v1.0.0, this package adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. We will publish with a major version bump for any breaking change to the public interface, use a minor version bump when introducing new features in a backwards-compatible way, and patch versions when introducing backwards-compatible bug fixes. Because of this, we recommend you import `0x.js` with a caret `^2.0.0` to take advantage of non-breaking bug fixes. -- cgit