From 0b59dcc469711e8b185f31202f2eed9f56d74244 Mon Sep 17 00:00:00 2001 From: Paul Vollmer Date: Mon, 29 Jan 2018 16:46:58 +0100 Subject: [PATCH] Added esdoc config --- .esdoc.json | 50 ++++++++++++++++++++++++++++++++++++++++ lib/inspector.js | 3 +++ lib/match.js | 3 +++ lib/nodeUtils.js | 3 +++ lib/reporters/base.js | 3 +++ lib/reporters/default.js | 3 +++ lib/reporters/json.js | 3 +++ lib/reporters/pmd.js | 3 +++ package.json | 7 +++++- 9 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .esdoc.json diff --git a/.esdoc.json b/.esdoc.json new file mode 100644 index 0000000..bb0891c --- /dev/null +++ b/.esdoc.json @@ -0,0 +1,50 @@ +{ + "source": "./lib", + "destination": "./docs", + "includes": ["\\.js$"], + "excludes": [], + "index": "./README.md", + "package": "./package.json", + "plugins": [ + { + "name": "esdoc-standard-plugin", + "option": { + "lint": {"enable": true}, + "coverage": {"enable": true}, + "accessor": {"access": ["public", "protected", "private"], "autoPrivate": true}, + "undocumentIdentifier": {"enable": false}, + "unexportedIdentifier": {"enable": true}, + "typeInference": {"enable": true}, + "brand": { + "logo": "", + "title": "jsinspect", + "description": "jsinspect", + "repository": "https://github.com/danielstjules/jsinspect", + "site": "", + "author": "https://github.com/danielstjules", + "image": "https://github.com/danielstjules/logo.png" + }, + "test": { + "source": "./spec/", + "interfaces": ["describe", "it", "context", "suite", "test"], + "includes": ["(spec|Spec|test|Test)\\.js$"], + "excludes": ["\\.config\\.js$"] + } + } + }, + { + "name": "esdoc-ecmascript-proposal-plugin", + "option": { + "classProperties": true, + "objectRestSpread": true, + "doExpressions": true, + "functionBind": true, + "functionSent": true, + "asyncGenerators": true, + "decorators": true, + "exportExtensions": true, + "dynamicImport": true + } + } + ] +} diff --git a/lib/inspector.js b/lib/inspector.js index a257dcc..0ce1950 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -7,6 +7,9 @@ var NodeUtils = require('./nodeUtils'); var crypto = require('crypto'); var stable = require('stable'); +/** + * + */ class Inspector extends EventEmitter { /** * Creates a new Inspector, which extends EventEmitter. filePaths is expected diff --git a/lib/match.js b/lib/match.js index 5c99deb..3fcb668 100644 --- a/lib/match.js +++ b/lib/match.js @@ -2,6 +2,9 @@ var strip = require('strip-indent'); var crypto = require('crypto'); var NodeUtils = require('./nodeUtils'); +/** + * + */ class Match { /** * Creates a new Match. diff --git a/lib/nodeUtils.js b/lib/nodeUtils.js index 0ad1918..350dc70 100644 --- a/lib/nodeUtils.js +++ b/lib/nodeUtils.js @@ -12,6 +12,9 @@ var childKeys = { JSXAttribute: ['name', 'value'], }; +/** + * + */ class NodeUtils { /** * Walks a root node's subtrees using DFS, invoking the passed callback with diff --git a/lib/reporters/base.js b/lib/reporters/base.js index 331acdf..8885a40 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -2,6 +2,9 @@ var util = require('util'); var path = require('path'); var chalk = require('chalk'); +/** + * + */ class BaseReporter { /** * A base reporter from which all others inherit. Registers a listener on the diff --git a/lib/reporters/default.js b/lib/reporters/default.js index e45797e..278a0a5 100644 --- a/lib/reporters/default.js +++ b/lib/reporters/default.js @@ -2,6 +2,9 @@ var util = require('util'); var chalk = require('chalk'); var BaseReporter = require('./base'); +/** + * + */ class DefaultReporter extends BaseReporter { /** * The default reporter, which displays both file and line information for diff --git a/lib/reporters/json.js b/lib/reporters/json.js index 36ec192..8ccb8ec 100644 --- a/lib/reporters/json.js +++ b/lib/reporters/json.js @@ -3,6 +3,9 @@ var path = require('path'); var chalk = require('chalk'); var BaseReporter = require('./base'); +/** + * + */ class JSONReporter extends BaseReporter { /** * A JSON reporter, which displays both file and line information for diff --git a/lib/reporters/pmd.js b/lib/reporters/pmd.js index 3aa1a9b..d98e5bc 100644 --- a/lib/reporters/pmd.js +++ b/lib/reporters/pmd.js @@ -3,6 +3,9 @@ var path = require('path'); var chalk = require('chalk'); var BaseReporter = require('./base'); +/** + * + */ class PMDReporter extends BaseReporter { /** * A PMD CPD XML reporter, which tries to fit jsinspect's output to something diff --git a/package.json b/package.json index 319b456..a45a2ba 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "devDependencies": { "concat-stream": "^1.5.0", "dirmap": "^0.0.2", + "esdoc": "^1.0.4", + "esdoc-ecmascript-proposal-plugin": "^1.0.0", + "esdoc-standard-plugin": "^1.0.0", "expect.js": "^0.3.1", "mocha": "^3.5.0" }, @@ -37,6 +40,8 @@ "jsinspect": "./bin/jsinspect" }, "scripts": { - "test": "mocha -R spec spec spec/reporters" + "test": "mocha -R spec spec spec/reporters", + "docs": "./node_modules/.bin/esdoc", + "docs-open": "npm run docs && open docs/index.html" } }