Commit Graph
19 Commits
Author SHA1 Message Date
Luke Schoen f6506dbabb refactor: Fixes #381. Fix spelling of extrinsic in param name (#384) 2018-11-08 10:10:11 +01:00
Luke Schoen 16bb9bbc1b refactor: Related #323. Try moving Gitbook logo generator into devDependencies (#333)
* refactor: Related #323. Try moving Gitbook logo generator into devDependencies

* refactor: Move all Gitbook plugins to devDependencies incl. babel plugin resolver
2018-10-21 13:21:48 +02:00
Luke Schoen e8e92cd0d5 fix: Fixes #288. Alphabetical ordering for Sections and Methods of RPC, Storage, and Extrinsics (#291)
* fix: Manual alphabetical ordering for Storage Substrate methods

* fix: Fixes #288. Alphabetical ordering for Sections and Methds of RPC, Storage, Extrinsics

* refactor: Move alphabetical sorting of Methods in Extrinsics Section into separate function

* refactor: Use localeCompare to sort more concisely
2018-10-17 07:12:43 +02:00
Luke Schoen 99b9332dfb fix: Fixes #289. Add Anchor links to Sections on Node interface pages Rpc, Storage, Extrinsics (#302)
* fix: Fixes #289. Add Anchor links to Sections on Node interfaces pages RPC, Storage, Extrinsics

* refactor: Add reusable functions to generate section links/header. Add constants for back to top link/anchor

* Add function with switch to generate section links to section anchors.

* Add common function to generate section header.

* Reuse common Anchor/Link HTML with constants.

* refactor: Rename generateAnchors to generateSectionLinks. Add reusable function for section link text
2018-10-15 23:35:26 +02:00
Luke Schoen b2c512fc8c fix: Change Readme contents to reflect implementation (#287)
* fix: Change Readme contents to reflect implementation

* Update README.md
2018-10-15 23:15:19 +02:00
Luke Schoen 3e20e7b10d docs: Fixes #275. Update Readme package names and links (#286)
* docs: Fixes #275. Update Readme package names and links

* Update README.md
2018-10-14 09:32:51 +02:00
Luke Schoen 68f5ac27ed docs: Relates to #268. Add Polkadot white logo. Match styles to apps (#277)
* docs: Relates to #268. Add Polkadot white logo. Match styles to apps

* fix: Change logo url for plugin to production link

* fix: Remove Polkadot logo

* feat: Add Polkadot-js logo

* fix: Adjust styles for Polkadot-js logo
2018-10-13 16:38:29 +02:00
Luke Schoen 85ebacb6de fix: Fix promise examples minor typos in comments and variable name. Capitalise comments (#276) 2018-10-13 08:56:27 +02:00
Luke Schoen 4748e8c87f docs: Relates to #193. Generate Substrate Interface methods in API docs for RPC, Storage, and Extrinsics from Metadata (#265)
* docs: Relates to #193. Generate Methods in API docs to Substrate Interfaces Extrinsics and Storage from Metadata

* Steps to generate Gitbook:
```
yarn run build:methodsdoc;
yarn run build;
yarn gitbook serve;
```

* Allows generating a docs/METHODS_STORAGE.md and docs/METHODS_EXTRINSICS.md files by running `yarn run build:methodsdoc`
  * Note: The script runs `node packages/types/src/MetadataMdWrapper.js`, which uses Babel.js to transpile the TypeScript file MetadataMd.ts into JavaScript as MetadataMd.js by using the babel-plugin-module-resolver dependency that has been added to package.json. It runs MetadataMd.js, which parses a hard-coded copy of a Metadata response from the Substrate Node, and then generates the two aforementioned Markdown files to be included in the Gitbook.
  * Important Note: DO NOT run `./node_modules/.bin/tsc packages/types/src/MetadataMd.ts; node packages/types/src/MetadataMd.js;`, as doing so may incorrectly transpile other TypeScript files, and will give errors like `TypeError: bn_js_1.default is not a constructor` when you run your unit tests.

* Added links that work when you go to http://localhost:4000/api/ and click the "api" link on the side menu
  * Note: This was achieved by first adding the links in packages/api/README.md (i.e. `[Extrinsics (Substrate Interface)](../METHODS_EXTRINSICS.md)`). Note that the links could also be `METHODS_EXTRINSICS.html` and it would still work. It is VERY important to add links to these Markdown files in docs/SUMMARY.md (i.e. `[Storage](METHODS_STORAGE.md)`), as Gitbook generates HTML files in the same docs/ directory (i.e. it generates docs/METHODS_STORAGE.html) for any links provided in that file, and when you run `yarn run build; yarn gitbook serve` it will put a copy of those HTML files in the _book directory so it can be accessed in the browser.

* Replaces PR #249 and #255 from jg-meta-md from jg-meta-md-luke branches

* feat: Add script to generate decoded JSON file of the Metadata. Remove test.

* Summary:
  * Running `yarn run build:decodedjson` will generate packages/types/src/Metadata.decoded.json from the Metadata in the Metadata.rpc.ts file.

* docs: Manually add RPC Substrate Interface API docs including author, chain, state, system

* docs: Append Storage Substrate methods to Storage Methods. Add consistent styling. Add descriptions

* Add Description at top of Substrate Interface page for RPC, Extrinsics, and Storage in API docs

* Add styling to Substrate Interface page for Extrinsics and Storage, including:
  * ▸ symbol before each method
  * bold method names
  * adding Summary label and only showing the summary label if a summary exists
  * adding a horizonal line between each section of methods

* Fix by adding new line after description when there is one in Extrinscis and Storage

* Manually creating a markdown file containing storage.substrate methods METHODS_STORAGE_SUBSTRATE.md, and then reading from the file and appending it to the bottom of the METHODS_STORAGE.md file that is generated, since the storage.substrate methods are not available from the Metadata.

* Fix by reading and writing to file using UTF8 instead of ASCII so symbols appear correctly

* Updating docs/METHODS_RPC.md and adding a horizontal line before the first section of methods

* docs: Fix Readme file step numbering

* docs: Generate the Substrate Interface Markdown files first when run yarn run build

* refactor: Move babel register config into shared file

* refactor: Use shared function to overcome codeclimate error

* fix: Reword description of RPC methodsto address review comment

* docs: Rename to Runtime Node Interfaces to address review comment

* docs: Rename to Runtime Node Interface in api Readme to address review comment

* docs: Fix minor typos

* docs: Fixes #117 providing Readme ref to jsonrpc docs

* fix: Remove preceding whitespace

* docs: Rename so RPC is not referred to as an interface of the runtime

* docs: Refer to Storage Substrate methods as always available to runtime implementation

* test: Restore the test that was unnecessary deleted

* Move scripts into packages/types/src/scripts

* docs: Add script to generate RPC interface docs

* fix: Fix TSlint error where element had any time due to no index signature

* refactor: Restore code back to normal instead of bowing to codeclimate whims

* refactor: Declare meaningful variables to make more readable

* docs: Show .subscribe when it is isSubscription method
2018-10-12 21:15:01 +02:00
Luke Schoen 82baafbe32 fix: Fixes #244. Adds correct link to RpcRx markdown file so RpcRx links in API docs work (#245) 2018-10-11 09:34:14 +02:00
Luke Schoen 3c8c4b0baf refactor: Fixes #239. Rename from RxRpc to RpcRx in rpc-rx types (#240) 2018-10-11 07:37:30 +02:00
Luke Schoen 1e9b69c507 fix: Fixes #221. Exclude tests files in build directory. Only use those in src (#222)
* fix: Fixes #221. Exclude tests files in build directory. Only use those in src

* See modulePathIgnorePatterns: https://jestjs.io/docs/en/configuration.html#modulepathignorepatterns-array-string

* fix: Update modulePathIgnorePatterns to cater for renamed packages

* Update modulePathIgnorePatterns to match renaming that occurred in PR #220

* test: Add build directory of api/rx to Jest config of modulePathIgnorePatterns
2018-10-10 23:31:48 +02:00
Luke Schoen 267411d778 fix: Fixes #235 TypeDoc updates consistent with renaming (#236)
* fix: Remove docs/api since replaced with docs/rpc-core

* fix: Remove docs/api-provider since replaced with docs/rpc-provider

* fix: Remove docs/api-rx since replaced with docs/rpc-rx

* fix: Remove the guide file that serves no purpose

* fix: Change license from ui-observable to api-observable

* fix: Remove disused mockHttp and mockWs that are duplicates of those in rpc-provider

* fix: Clarifies difference between PropIndex and ProposalIndex from Issue #226

* fix: Update api-observable Readme to refer to rpc-core, previously called api

* misc: Update Readme of rpc-core. See commit message details.

* Update name to be @polkadot/rpc-core instead of @polkadot/api

* Use Yarn instead of NPM for instructions adding dependencies

* Refer to @polkadot/rpc-core as `Rpc`

* Highlight that given block header hash should be a 0x-prefixed hex string with length of 64 (not only length of 10 as shown in the example)

* Showcase more information that you can obtain from the header object (i.e. best block number, parentHash, stateRoot, extrinsicsRoot, and digest)

* Use `header.raw` instead of just `header` to access properties of the header object

* Update the example to console.log the subscription ID

* Add missing semicolon

* fix: Fix name in license header and rename Api to Rpc for rpc-core e2e tests

* fix: Update rpc-provider Readme to use Yarn instead of NPM install

* fix: Fix minor typo

* fix: Rename Api to Rpc for rpc-provider ws

* fix: Refer to rpc-core instead of api in the rpc-rx Readme

* fix: Update rpc-rx files to refer to it as RpcRx instead of RxApi or just Api

* fix: Refer to rpc-core as Rpc instead of Api

* fix: Update type-jsonrpc Readme. Fix typo. Use Yarn not NPM. Refer to TSLint not Flow

* refactor: Move non-type dependency import with non-type dependencies

* docs: Add link to parity-codec repo

* fix: Avoid use of .raw. Fix listen to blocks example

* fix: Add missing error to newHead in listen to blocks example
2018-10-10 20:11:22 +02:00
Luke Schoen bba764bd28 feat: Fixes #210. Add Mermaid.js Gitbook plugin. Generate API flow diagram (#211)
* feat: Add Mermaid.js Gitbook plugin. Generate API flow diagram

* fix: Remove HTTP from diagram. Change text to funnel user to WS
2018-10-10 13:16:36 +02:00
Luke Schoen ae54a71dc9 fix: Fixes #208. Uses correct HTTP or WS URL prefix and port (#209) 2018-10-05 23:00:20 +02:00
Luke Schoen d4990f8381 fix: Fixes #204. Adds coloured syntax highlighting to TypeDoc code examples (#207)
* fix: Fixes #204. Adds coloured syntax highlighting to TypeDoc code examples

* Add Gitbook plugin Sunlight Highlighter https://www.npmjs.com/package/gitbook-plugin-sunlight-highlighter

* Still requires use of <BR> HTML element to shift code onto a new line

* Example use of Sunlight Highlighter from their README `javascript+theme:gitbook+lineNumbers:true+lineNumberStart:100` (in this example it uses their gitbook theme with line numbers shown and line numbers starting from 100)

* Updated book.json to add the Sunlight Highlighter plugin, and explicitely configured it to use the gitbook theme by default

* Enable showing line numbers only on TypeDoc example code that is longer (i.e. 8 lines long)

* fix: Remove unnecessary inline config for no line numbers since is default

* fix: Remove use of line numbers so consistent with the rest
2018-10-05 17:34:32 +02:00
Luke Schoen fd596a1eb4 fix: Fixes #154 Modify TypeDocs that change the source to resolve rendering correctly (#203)
* fix: Modify TypeDocs that change the source to resolve rendering correctly

* Add TypeDoc/TSDoc labels

* Use HTML <BR> element in TypeDoc to generate new lines even to achieve a newline between lines of code

* Use HTML <PRE><CODE> combination in TypeDoc for multiple line code generation

* Add missing TypeDocs for HTTP `constructor` and `send` for HTTP and WS

* Remove unnecessary assignment of `= true` default value in TypeDoc @param value and clean up text alignment

* Verified that it displays correctly in development environment by running `yarn; yarn polkadot-dev-build-docs; yarn gitbook serve`, and then navigating to localhost:4000

* fix: remove signature that was used with jsdocs flowtype
2018-10-05 08:42:32 +02:00
Luke Schoen 522eae643d fix: Fixes #168 by adding development instructions and tutorial link (#205)
* fix: Fixes #168 by adding development instructions and tutorial link

* fix: Change to just using yarn run build
2018-10-04 22:11:01 +02:00
Luke Schoen f399bb6fd6 docs: Fixes #154 (#167)
* Move triple backticks onto new line so it doesn't break the code snippet formatting

* Add newline between dependency imports and variable declarations

* Add link to relevant line of Github repo of eventemitter3 instead of the travis build directory

* Add full stop at end of sentence in line before `@example` in .ts files, since I noticed that was the only difference between code snippet in docs that was being rendered correctly and one that was not (if the docs were generated from it). Not sure if this actually makes any difference though, but it doesn't hurt to try. i.e. change `[[unsubscribe]]` to `[[unsubscribe]].`

* Add missing code syntax for `new Ws(defaults.WS_URL)`

* Add missing `*__example__*:`

* Add missing semi-colons throughout code

* Fix typos and some grammar

* Move import of external libraries i.e. `const BN = require('bn.js');` or `const crypto = require('crypto');` before `@polkadot` ones in code

* Change from `e` to `error` in catch blocks for readable documentation
2018-09-26 07:24:03 +02:00