diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 58da2f25c..4dbc3088d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -23,11 +23,14 @@ jobs: - name: Install run: sudo apt-get install -y libunbound-dev | - npm install nyc coveralls bslint + npm install nyc coveralls bslint jsdoc - name: Lint run: npm run lint + - name: Build Docs + run: npm run build-docs + - name: Test run: npm run test-ci diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a84618f4..db84d605e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,14 +5,16 @@ This repository includes a file [.eslintrc.json](.eslintrc.json) which sets linting preferences for the project. The continuous integration bot will install [bslint](https://www.npmjs.com/package/bslint) which vendors a specific -version of eslint. Before submitting a pull request, please make sure your code -is clean of linting errors. If you choose to use bslint, it can be installed -globally in your development environment: +version of eslint and [jsdoc](https://www.npmjs.com/package/jsdoc). Before +submitting a pull request, please make sure your code is clean of linting errors +and has a valid documentation. If you choose to use bslint and/or jsdoc, they can +be installed globally in your development environment: ``` -npm install bslint -g -cd hsd # must be in repository root -npm run lint # command is defined in package.json +npm install bslint jsdoc -g +cd hsd # must be in repository root +npm run lint # command is defined in package.json +npm run build-docs # also defined in package.json ``` ## Testing @@ -41,7 +43,7 @@ Recent workflow actions are available: https://github.com/handshake-org/hsd/actions All code changes should be covered by new tests if applicable. We currently use -Coveralls to examine test coverage, and a pull request that *decreases* test +Coveralls to examine test coverage, and a pull request that _decreases_ test coverage will likely not be reviewed by contributors or maintainers. Current test coverage details are available: @@ -68,6 +70,3 @@ example of this is in [this commit](https://github.com/handshake-org/hsd/commit/c385fc59d488f5cd592a1d23554fe1c018bf26da). Note how the author used a very brief commit message as the title but then added a detailed description in the extended message. - - - diff --git a/lib/wallet/path.js b/lib/wallet/path.js index 1edb686cf..f3e9f9195 100644 --- a/lib/wallet/path.js +++ b/lib/wallet/path.js @@ -213,7 +213,7 @@ class Path extends bio.Struct { /** * Convert path object to string derivation path. - * @param {String|Network} [network] - Network type. + * @param {(String|Network)?} network - Network type. * @returns {String} */ @@ -243,7 +243,7 @@ class Path extends bio.Struct { /** * Convert path to a json-friendly object. - * @param {String|Network} [network] - Network type. + * @param {(String|Network)?} network - Network type. * @returns {Object} */ diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index e7b54a365..6f9d8d137 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -1832,7 +1832,9 @@ class Wallet extends EventEmitter { * @param {Number} value * @param {Number} lockup * @param {Object} options - * @returns {{ bid: MTX; reveal: MTX;}} {bid, reveal} + * @returns {Object} output + * @returns {MTX} output.bid + * @returns {MTX} output.reveal */ async createAuctionTxs(name, value, lockup, options) { @@ -1851,7 +1853,9 @@ class Wallet extends EventEmitter { * @param {Number} value * @param {Number} lockup * @param {Object} options - * @returns {{ bid: MTX; reveal: MTX;}} {bid, reveal} + * @returns {Object} output + * @returns {MTX} output.bid + * @returns {MTX} output.reveal */ async _createAuctionTxs(name, value, lockup, options) { diff --git a/package.json b/package.json index a03472e59..844d3e21c 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "hsw-cli": "./bin/hsw-cli" }, "scripts": { + "build-docs": "jsdoc -c jsdoc.json", "lint": "eslint $(cat .eslintfiles)", "lint-file": "eslint", "test": "bmocha --reporter spec test/*.js",