esdoc / esdoc Goto Github PK
View Code? Open in Web Editor NEWESDoc - Good Documentation for JavaScript
Home Page: https://esdoc.org
License: MIT License
ESDoc - Good Documentation for JavaScript
Home Page: https://esdoc.org
License: MIT License
$ esdoc -c esdoc.json
/usr/local/lib/node_modules/esdoc/out/src/Plugin/Plugin.js:67
throw _iteratorError;
^
Error: Cannot find module 'esdoc-es7-plugin'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Plugin._execHandler (/usr/local/lib/node_modules/esdoc/out/src/Plugin/Plugin.js:48:22)
at Plugin.onStart (/usr/local/lib/node_modules/esdoc/out/src/Plugin/Plugin.js:76:12)
at Function.generate (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:96:35)
at ESDocCLI.exec (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:88:28)
at Object.<anonymous> (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:142:7)
at Module._compile (module.js:460:26)
/**
* @example <caption> this is example caption</caption>
* let foo = 123;
*/
function bar(){ ... }
see
Thanks for putting together a library that generates ES6 docs! I ran into a few errors with a standard run:
esdoc.json:
{
"source": "./src",
"destination": "./doc",
"autoPrivate": true,
"coverage": true
}
errors:
/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:379
throw _iteratorError5;
^
TypeError: Cannot read property 'name' of null
at DocFactory._joinSeparatedExport (/usr/local/lib/node_modules/esdoc/out/src/Factory/DocFactory.js:141:54)
at new DocFactory (/usr/local/lib/node_modules/esdoc/out/src/Factory/DocFactory.js:87:10)
at Function._traverse (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:409:21)
at /usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:169:26
at Function._walk (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:363:13)
at Function._walk (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:365:18)
at Function.generate (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:112:12)
at ESDocCLI.exec (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:88:28)
at Object.<anonymous> (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:159:7)
at Module._compile (module.js:410:26)
/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/SearchIndexBuilder.js:106
throw _iteratorError;
^
TypeError: Cannot read property 'kind' of undefined
at SearchIndexBuilder._getOutputFileName (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:745:18)
at SearchIndexBuilder._getOutputFileName (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:757:23)
at SearchIndexBuilder._getURL (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:728:29)
at SearchIndexBuilder.exec (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/SearchIndexBuilder.js:76:24)
at publish (/usr/local/lib/node_modules/esdoc/out/src/Publisher/publish.js:125:62)
at Function.generate (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:185:7)
at ESDocCLI.exec (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:88:28)
at Object.<anonymous> (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:159:7)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:428:10)
In the first case, I simply commented out the offending line:
//if (node2.id.name !== node1.declaration.name) continue;
In the second, I wrapped the block in an if statement, which checked for the argument passed to the function:
value: function _getOutputFileName(doc) {
if (doc) {
switch (doc.kind) {
case 'variable':
return 'variable/index.html';
// ...
}
}
}
In this way, I got the commands to work, but I'm not sure it generated proper docs.
Let me know if there is anything else I can do to help you reproduce. I would also like to see a config option to turn off stdout if there is not one already.
/**
* @param {myCallback} callback - this is callback.
*/
export function myFunction(callback){}
/**
* @typedef {function} myCallback
* @param {number} foo - this is foo.
* @param {string} bar - this is bar.
*/
esdoc fails on certain projects, but I can't see what is the cause.
/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:79
throw _iteratorError;
^
TypeError: Cannot read property 'indexOf' of undefined
at ClassDocBuilder._buildSignatureHTML (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1052:26)
at /Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:460:38
at IceCap.loop (/Users/matt/dev/test/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:319:15)
at ClassDocBuilder._buildSummaryDoc (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:457:11)
at ClassDocBuilder._buildSummaryHTML (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:416:29)
at ClassDocBuilder._buildClassDoc (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:167:38)
at ClassDocBuilder.exec (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:64:36)
at publish (/Users/matt/dev/test/node_modules/esdoc/out/src/Publisher/publish.js:132:59)
at Function.generate (/Users/matt/dev/test/node_modules/esdoc/out/src/ESDoc.js:199:7)
at ESDocCLI.exec (/Users/matt/dev/test/node_modules/esdoc/out/src/ESDocCLI.js:88:28)
Plugin provides some hook point. And users can customize data at hook points.
config
{
"source": "./src",
"destination": "./esdoc",
"plugins": [
{"name": "foo-esdoc-plugin", "option": {}},
{"name": "./bar-esdoc-plugin.js", "option": {}}
]
}
plugin
exports.onStart = function(ev){...};
exports.onHandleConfig = function(ev){...};
exports.onHandleCode = function(ev){...};
exports.onHandleCodeParser = function(ev){...};
exports.onHandleAST = function(ev){...};
exports.onHandleTag = function(ev){...};
exports.onHandleHTML = function(ev){...};
exports.onComplete = function(ev){...};
Deprecated coverage badge in README.md.
Use badge of ESDoc Hosting Service instead.
I sometimes manipulate properties of my class via this[property] = value. This however generates a public member 'property' in my ESDoc generated document:
class Foo {
/**
* Creates a new instance of Foo
*
* @constructor
*/
constructor() {
/** @type {string} */
this.foo = 'bar';
}
/**
* Set the given property in the class.
*
* @param {string} property property to set
* @param {*} value new value
*/
manipulate(property, value) {
this[property] = value;
}
}
Any plans for it? (since babel supports it out of the box anyway)
ESDoc creates coverage badge(svg) in root dir. (like travis badge)
So, if you have the following snippet:
/**
* Test function
* @return {void}
*/
const TestFunction = function() {
console.log('test');
};
export {TestFunction};
Esdoc will not generate any documentation for this.
But if you change it to this:
/**
* Test function
* @return {void}
*/
export const TestFunction = function() {
console.log('test');
};
It'll work as expected.
This does not affects Classes - for them everything is generated OK for both cases.
I am building two ES6 module-based JavaScript applications which both build on top of a common library of modules:
app1/
src/
foo1.js
bar1.js
app2/
src/
foo2.js
bar2.js
lib/
common.js
another.js
So after compilation, app1 ends up with the modules app1/common, app1/another, app1/foo1, and app1/bar1.
Likewise, app2 ends up with the modules app2/common, app2/another, app2/foo2, and app2/bar2.
What is the best approach to generate docs in this scenario?
If I just generate docs individually for app1 and app2, then the docs don't contain proper references to the classes in lib.
I was thinking it might help if I could specify multiple source directories in esdoc config. So I could generate docs for app1+lib, and then app2+lib.
What do you think?
esdoc 0.1.2
node 0.10.38
$ cat esdoc.json
{
"source": "src",
"destination": "doc"
}
$ tree src/
src/
└── test.js
0 directories, 1 file
$ cat src/test.js
class A {
/**
* @function
*/
a(){}
}
$ esdoc -c esdoc.json
~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/ESDoc.js:378
throw _iteratorError5;
^
TypeError: Cannot read property 'name' of undefined
at FunctionDoc.name (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Doc/FunctionDoc.js:59:39)
at FunctionDoc._apply (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Doc/AbstractDoc.js:68:20)
at FunctionDoc.AbstractDoc (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Doc/AbstractDoc.js:54:10)
at new FunctionDoc (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Doc/FunctionDoc.js:34:20)
at DocFactory._createDoc (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Factory/DocFactory.js:388:14)
at DocFactory._traverseComments (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Factory/DocFactory.js:318:24)
at DocFactory.push (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Factory/DocFactory.js:206:26)
at Controller.<anonymous> (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/ESDoc.js:411:17)
at Controller.enter (~/.nvm/v0.10.38/lib/node_modules/esdoc/out/src/Util/ASTUtil.js:42:20)
at Controller.__execute (~/.nvm/v0.10.38/lib/node_modules/esdoc/node_modules/estraverse/estraverse.js:397:31)
上の設定でエラーになってしまい document が生成できないようでした。
@function
タグが基本的にうまく処理できていないように見えました。
Anonymous class can not description.
this is espree bug and already fixed.
eslint/js#158
See https://github.com/wycats/javascript-decorators#class-declaration
@F("color")
@G
class Foo {
}
ESDoc fails to generate any docs for class Foo
.
Hi, great work!
Any plans to extend Esdoc to be able to render using custom templates?
Hi, please see my coverage stats here: http://luna-aphelionz.c9.io/waterhero/client/doc/source.html
As I work through my docs and tests I can't seem to get 100% coverage on any particular file. I was hoping something obvious would occur to me, but it hasn't happened yet.
What else is esdoc expecting for 100% coverage?
Deprecated config.importPathPrefix.
Use esdoc-importpath-plugin instead
Don't parse es-function-bind ::
I know in the FAQ it says ES7 is not supported, but many people are now making use of this feature e.g. http://babeljs.io/blog/2015/06/07/react-on-es6-plus/ using Babel.
Currently the doc generator fails if it encounters any property initialisers.
Is there any possibility you would consider adding support for this?
While parsing the following docblock:
/**
* Usage
* -----
*
* <div id="pg">
* <div data-pagination-value>1</div>
* of
* <div data-pagination-max>10</div>
* </div>
*/
ESDoc replaces all code containing HTML elements by actual HTML elements, which is undesired in a code block:
Is there a way to achieve this in another way (I tried with triple backquotes, same issue), or disable HTML in comments entirely?
All in all, additional dots '.' in the filename break the inheritance functionality.
Hi guys!
I've noticed that some of features have been missed in "ecmaFeatures" list in parser. I think whole React.js community will be grateful if you turn on "experimentalObjectRestSpread" feature.
Thank you!
fs.js:565
fs.write = function(fd, buffer, offset, length, position, callback) {
^
Error: ENOENT, no such file or directory './test/fixture/package.json'
at Error (native)
at Object.fs.openSync (fs.js:500:18)
at Object.fs.readFileSync (fs.js:352:15)
at IdentifiersDocBuilder._getInfo (/Users/h13i32maru/work/esdoc/src/Publisher/Builder/DocBuilder.js:134:21)
at IdentifiersDocBuilder._buildLayoutDoc (/Users/h13i32maru/work/esdoc/src/Publisher/Builder/DocBuilder.js:176:21)
at IdentifiersDocBuilder.exec (/Users/h13i32maru/work/esdoc/src/Publisher/Builder/IdentifiersDocBuilder.js:14:20)
at publish (/Users/h13i32maru/work/esdoc/src/Publisher/publish.js:72:43)
at /Users/h13i32maru/work/esdoc/test/src/000init.js:20:3
at Function.generate (/Users/h13i32maru/work/esdoc/src/ESDoc.js:95:5)
at Object.<anonymous> (/Users/h13i32maru/work/esdoc/test/src/000init.js:10:7)
at Module._compile (module.js:460:26)
at normalLoader (/Users/h13i32maru/work/esdoc/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:166:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/h13i32maru/work/esdoc/node_modules/babel/node_modules/babel-core/lib/babel/api/register/node.js:179:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /Users/h13i32maru/work/esdoc/node_modules/mocha/lib/mocha.js:192:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/h13i32maru/work/esdoc/node_modules/mocha/lib/mocha.js:189:14)
at Mocha.run (/Users/h13i32maru/work/esdoc/node_modules/mocha/lib/mocha.js:422:31)
at Object.<anonymous> (/Users/h13i32maru/work/esdoc/node_modules/mocha/bin/_mocha:398:16)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
child_process.js:1389
throw err;
Now, supports following url in package.json
{
"repository": {
"type": "git",
"url": "https://github.com/foo/bar"
}
}
But, does not support following url in package.json
"repository": {
"type": "git",
"url": "[email protected]:foo/bar.git",
}
Hi guys,
we've written a small function that generate the documentation in different folder (not just a flax index).
The visual result is something like that:
root:
folder1:
file1
folder2:
folder2.1:
file2
this is our source code:
https://github.com/daniele-zurico/es6-webpack-angular/blob/master/vendor/doc-menu.js
https://github.com/daniele-zurico/es6-webpack-angular/blob/master/vendor/doc-style.css
https://github.com/daniele-zurico/es6-webpack-angular/blob/master/esdoc.json
{
"source": "./app",
"destination": "./target/docs",
"autoPrivate": true,
"scripts": ["./vendor/doc-menu.js", "./bower_components/jquery/dist/jquery.min.js", "./vendor/jstorage.min.js"],
"styles": ["./vendor/doc-style.css", "./vendor/font-awesome-4.3.0/css/font-awesome.min.css"]
}
If config is the following json, documentation generating is fail.
{
"source": "./",
"destination": "./doc"
}
Would you be interested in using a more complete logging solution?
There is chalk
which is the most popular, I could help you integrate it.
There is also my own clor
, which is just 30 lines of code.
Cheers
So, my config looks like this:
{
"source": "./src",
"destination": "./esdoc"
}
And if I try to run it on blank rxmq project I get the following error:
➜ rxmq.js git:(master) ✗ esdoc -c esdoc.json
identifiers.html
index.html
/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:77
throw _iteratorError;
^
TypeError: Cannot read property 'indexOf' of undefined
at ClassDocBuilder._buildSignatureHTML (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1041:26)
at /usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:451:38
at IceCap.loop (/usr/local/lib/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:319:15)
at ClassDocBuilder._buildSummaryDoc (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:448:11)
at ClassDocBuilder._buildSummaryHTML (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:407:29)
at ClassDocBuilder._buildClassDoc (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:158:38)
at ClassDocBuilder.exec (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:62:36)
at publish (/usr/local/lib/node_modules/esdoc/out/src/Publisher/publish.js:121:59)
at Function.generate (/usr/local/lib/node_modules/esdoc/out/src/ESDoc.js:189:7)
at ESDocCLI.exec (/usr/local/lib/node_modules/esdoc/out/src/ESDocCLI.js:88:28)
Any thoughts why that might happen?
Using iojs v2.3.3, npm v.2.12.1
ESDoc has internal tags that are compatible with JSDoc tag name(@name, @memberof, etc...
).
But, these tags are not good.
I change these tags to incompatible name with JSDoc.
let foo;
class Foo {}
foo = new Foo();
export {foo}
Currently, an error occurs when target files includes extending nested object class.
import React from 'react';
/**
* This is App
*/
export default class App extends React.Component {
/**
* @return {ReactElement} markup
*/
render() {
React.createElement('div', {});
}
}
TypeError: Cannot read property 'match' of null
at CoverageBuilder._findByName (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:124:25)
at extendsChain (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/DocResolver.js:365:47)
at DocResolver._resolveExtendsChain (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/DocResolver.js:550:11)
at DocResolver.resolve (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/DocResolver.js:56:12)
at CoverageBuilder.DocBuilder (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:53:42)
at new CoverageBuilder (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/Builder/CoverageBuilder.js:32:19)
at publish (/Users/koba04/project/node_modules/esdoc/out/src/Publisher/publish.js:116:35)
at Function.generate (/Users/koba04/project/node_modules/esdoc/out/src/ESDoc.js:185:7)
at ESDocCLI.exec (/Users/koba04/project/node_modules/esdoc/out/src/ESDocCLI.js:90:28)
at Object.<anonymous> (/Users/koba04/project/node_modules/esdoc/out/src/ESDocCLI.js:192:7)
Do you have a plan that support this case?
Here is my esdoc.json
{
"source": "./src",
"destination": "./docs",
"title": "schema-mapper-spec"
}
In src there is one index.js file with the following contents:
import isObject from 'lodash.isobject';
/**
* A container for data that also includes the schema and version.
* @typedef {Object} DataInfo
* @property {String} schema The name of the schema
* @property {(Number|String)} version The version of the schema
* @property {Object} data An object containing the data
*/
/**
* A schema describing the properties of data.
* @typedef {Object} Schema
* @property {String} name The name of the schema
* @property {Object} columns An object of columns where the key is the unique id for the column and the value is an object of type Column
*/
/**
* A column describing a single property of data.
* @typedef {Object} Column
* @property {String} name The name of the column
* @property {String} type The type of the column
*/
/**
* An array of changes containing items of type Change
* @typedef {Array} Changes
*/
/**
* A change indicating a modification to a schema or column.
* @typedef {Object} Change
* @property {String} id The id of the schema that this change applies to
* @property {String} change A string indicating the type of change,
* this can be any of:
* - schema.create
* - schema.rename
* - schema.remove
* - column.create
* - column.rename
* - column.remove
* - column.typechange
*/
/**
* A result of the validation containing errors when failed.
* @typedef {Object} ValidationResult
*/
/**
* A validator that can be used to validate the following objects:
* - DataInfo
* - Schema
* - Changes
*/
class SpecValidator {
/**
* Validate a DataInfo object
* @param {DataInfo} dataInfo A DataInfo object
* @return {ValidationResult} A ValidationResult
*/
validateDataInfo(dataInfo) {
if ( ! isObject(dataInfo)) {
}
}
/**
* Validate a Schema
* @param {Schema} schema A Schema
* @return {ValidationResult} A ValidationResult
*/
validateSchema(schema) {
}
/**
* Validate Changes
* @param {Changes} changes A Changes array
* @return {ValidationResult} A ValidationResult
*/
validateChanges(changes) {
}
}
export default new SpecValidator;
When I inspect the AST, I see the typedef showing up multiple times, here is the AST for index.js:
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "isObject",
"range": [
7,
15
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 15
}
}
},
"range": [
7,
15
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 15
}
}
}
],
"source": {
"type": "Literal",
"value": "lodash.isobject",
"raw": "'lodash.isobject'",
"range": [
21,
38
],
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 38
}
}
},
"range": [
0,
39
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema The name of the schema\n * @property {(Number|String)} version The version of the schema\n * @property {Object} data An object containing the data\n ",
"range": [
40,
343
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name The name of the schema\n * @property {Object} columns An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
"range": [
345,
635
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 15,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
"range": [
637,
822
],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 22,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
"range": [
824,
914
],
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 27,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n * - schema.create\n * - schema.rename\n * - schema.remove\n * - column.create\n * - column.rename\n * - column.remove\n * - column.typechange\n ",
"range": [
916,
1322
],
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A result of the validation containing errors when failed.\n * @typedef {Object} ValidationResult\n ",
"range": [
1325,
1434
],
"loc": {
"start": {
"line": 44,
"column": 1
},
"end": {
"line": 47,
"column": 4
}
}
},
{
"type": "Block",
"value": "*\n * A validator that can be used to validate the following objects:\n * - DataInfo\n * - Schema\n * - Changes\n ",
"range": [
1436,
1552
],
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 54,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "SpecValidator",
"range": [
1559,
1572
],
"loc": {
"start": {
"line": 55,
"column": 6
},
"end": {
"line": 55,
"column": 19
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateDataInfo",
"range": [
1724,
1740
],
"loc": {
"start": {
"line": 61,
"column": 2
},
"end": {
"line": 61,
"column": 18
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "dataInfo",
"range": [
1741,
1749
],
"loc": {
"start": {
"line": 61,
"column": 19
},
"end": {
"line": 61,
"column": 27
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "isObject",
"range": [
1764,
1772
],
"loc": {
"start": {
"line": 62,
"column": 11
},
"end": {
"line": 62,
"column": 19
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "dataInfo",
"range": [
1773,
1781
],
"loc": {
"start": {
"line": 62,
"column": 20
},
"end": {
"line": 62,
"column": 28
}
}
}
],
"range": [
1764,
1782
],
"loc": {
"start": {
"line": 62,
"column": 11
},
"end": {
"line": 62,
"column": 29
}
}
},
"prefix": true,
"range": [
1762,
1782
],
"loc": {
"start": {
"line": 62,
"column": 9
},
"end": {
"line": 62,
"column": 29
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [],
"range": [
1784,
1791
],
"loc": {
"start": {
"line": 62,
"column": 31
},
"end": {
"line": 63,
"column": 5
}
}
},
"alternate": null,
"range": [
1757,
1791
],
"loc": {
"start": {
"line": 62,
"column": 4
},
"end": {
"line": 63,
"column": 5
}
}
}
],
"range": [
1751,
1795
],
"loc": {
"start": {
"line": 61,
"column": 29
},
"end": {
"line": 64,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
1740,
1795
],
"loc": {
"start": {
"line": 61,
"column": 18
},
"end": {
"line": 64,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
1724,
1795
],
"loc": {
"start": {
"line": 61,
"column": 2
},
"end": {
"line": 64,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate a DataInfo object\n * @param {DataInfo} dataInfo A DataInfo object\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1577,
1721
],
"loc": {
"start": {
"line": 56,
"column": 2
},
"end": {
"line": 60,
"column": 5
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Validate a Schema\n * @param {Schema} schema A Schema\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1799,
1920
],
"loc": {
"start": {
"line": 66,
"column": 2
},
"end": {
"line": 70,
"column": 5
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateSchema",
"range": [
1923,
1937
],
"loc": {
"start": {
"line": 71,
"column": 2
},
"end": {
"line": 71,
"column": 16
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "schema",
"range": [
1938,
1944
],
"loc": {
"start": {
"line": 71,
"column": 17
},
"end": {
"line": 71,
"column": 23
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
1946,
1951
],
"loc": {
"start": {
"line": 71,
"column": 25
},
"end": {
"line": 72,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
1937,
1951
],
"loc": {
"start": {
"line": 71,
"column": 16
},
"end": {
"line": 72,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
1923,
1951
],
"loc": {
"start": {
"line": 71,
"column": 2
},
"end": {
"line": 72,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate a Schema\n * @param {Schema} schema A Schema\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1799,
1920
],
"loc": {
"start": {
"line": 66,
"column": 2
},
"end": {
"line": 70,
"column": 5
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Validate Changes\n * @param {Changes} changes A Changes array\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1955,
2084
],
"loc": {
"start": {
"line": 74,
"column": 2
},
"end": {
"line": 78,
"column": 5
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateChanges",
"range": [
2087,
2102
],
"loc": {
"start": {
"line": 79,
"column": 2
},
"end": {
"line": 79,
"column": 17
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "changes",
"range": [
2103,
2110
],
"loc": {
"start": {
"line": 79,
"column": 18
},
"end": {
"line": 79,
"column": 25
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
2112,
2117
],
"loc": {
"start": {
"line": 79,
"column": 27
},
"end": {
"line": 80,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
2102,
2117
],
"loc": {
"start": {
"line": 79,
"column": 17
},
"end": {
"line": 80,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
2087,
2117
],
"loc": {
"start": {
"line": 79,
"column": 2
},
"end": {
"line": 80,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate Changes\n * @param {Changes} changes A Changes array\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1955,
2084
],
"loc": {
"start": {
"line": 74,
"column": 2
},
"end": {
"line": 78,
"column": 5
}
}
}
],
"static": false
}
],
"range": [
1573,
2119
],
"loc": {
"start": {
"line": 55,
"column": 20
},
"end": {
"line": 81,
"column": 1
}
}
},
"range": [
1553,
2119
],
"loc": {
"start": {
"line": 55,
"column": 0
},
"end": {
"line": 81,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema The name of the schema\n * @property {(Number|String)} version The version of the schema\n * @property {Object} data An object containing the data\n ",
"range": [
40,
343
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name The name of the schema\n * @property {Object} columns An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
"range": [
345,
635
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 15,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
"range": [
637,
822
],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 22,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
"range": [
824,
914
],
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 27,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n * - schema.create\n * - schema.rename\n * - schema.remove\n * - column.create\n * - column.rename\n * - column.remove\n * - column.typechange\n ",
"range": [
916,
1322
],
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A result of the validation containing errors when failed.\n * @typedef {Object} ValidationResult\n ",
"range": [
1325,
1434
],
"loc": {
"start": {
"line": 44,
"column": 1
},
"end": {
"line": 47,
"column": 4
}
}
},
{
"type": "Block",
"value": "*\n * A validator that can be used to validate the following objects:\n * - DataInfo\n * - Schema\n * - Changes\n ",
"range": [
1436,
1552
],
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 54,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"declaration": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "SpecValidator",
"range": [
2140,
2153
],
"loc": {
"start": {
"line": 83,
"column": 19
},
"end": {
"line": 83,
"column": 32
}
}
},
"arguments": [],
"range": [
2136,
2153
],
"loc": {
"start": {
"line": 83,
"column": 15
},
"end": {
"line": 83,
"column": 32
}
}
},
"range": [
2121,
2154
],
"loc": {
"start": {
"line": 83,
"column": 0
},
"end": {
"line": 83,
"column": 33
}
}
},
{
"type": "ExportDefaultDeclaration",
"declaration": {
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "SpecValidator",
"range": [
1559,
1572
],
"loc": {
"start": {
"line": 55,
"column": 6
},
"end": {
"line": 55,
"column": 19
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateDataInfo",
"range": [
1724,
1740
],
"loc": {
"start": {
"line": 61,
"column": 2
},
"end": {
"line": 61,
"column": 18
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "dataInfo",
"range": [
1741,
1749
],
"loc": {
"start": {
"line": 61,
"column": 19
},
"end": {
"line": 61,
"column": 27
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "isObject",
"range": [
1764,
1772
],
"loc": {
"start": {
"line": 62,
"column": 11
},
"end": {
"line": 62,
"column": 19
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "dataInfo",
"range": [
1773,
1781
],
"loc": {
"start": {
"line": 62,
"column": 20
},
"end": {
"line": 62,
"column": 28
}
}
}
],
"range": [
1764,
1782
],
"loc": {
"start": {
"line": 62,
"column": 11
},
"end": {
"line": 62,
"column": 29
}
}
},
"prefix": true,
"range": [
1762,
1782
],
"loc": {
"start": {
"line": 62,
"column": 9
},
"end": {
"line": 62,
"column": 29
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [],
"range": [
1784,
1791
],
"loc": {
"start": {
"line": 62,
"column": 31
},
"end": {
"line": 63,
"column": 5
}
}
},
"alternate": null,
"range": [
1757,
1791
],
"loc": {
"start": {
"line": 62,
"column": 4
},
"end": {
"line": 63,
"column": 5
}
}
}
],
"range": [
1751,
1795
],
"loc": {
"start": {
"line": 61,
"column": 29
},
"end": {
"line": 64,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
1740,
1795
],
"loc": {
"start": {
"line": 61,
"column": 18
},
"end": {
"line": 64,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
1724,
1795
],
"loc": {
"start": {
"line": 61,
"column": 2
},
"end": {
"line": 64,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate a DataInfo object\n * @param {DataInfo} dataInfo A DataInfo object\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1577,
1721
],
"loc": {
"start": {
"line": 56,
"column": 2
},
"end": {
"line": 60,
"column": 5
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Validate a Schema\n * @param {Schema} schema A Schema\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1799,
1920
],
"loc": {
"start": {
"line": 66,
"column": 2
},
"end": {
"line": 70,
"column": 5
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateSchema",
"range": [
1923,
1937
],
"loc": {
"start": {
"line": 71,
"column": 2
},
"end": {
"line": 71,
"column": 16
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "schema",
"range": [
1938,
1944
],
"loc": {
"start": {
"line": 71,
"column": 17
},
"end": {
"line": 71,
"column": 23
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
1946,
1951
],
"loc": {
"start": {
"line": 71,
"column": 25
},
"end": {
"line": 72,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
1937,
1951
],
"loc": {
"start": {
"line": 71,
"column": 16
},
"end": {
"line": 72,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
1923,
1951
],
"loc": {
"start": {
"line": 71,
"column": 2
},
"end": {
"line": 72,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate a Schema\n * @param {Schema} schema A Schema\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1799,
1920
],
"loc": {
"start": {
"line": 66,
"column": 2
},
"end": {
"line": 70,
"column": 5
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Validate Changes\n * @param {Changes} changes A Changes array\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1955,
2084
],
"loc": {
"start": {
"line": 74,
"column": 2
},
"end": {
"line": 78,
"column": 5
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "validateChanges",
"range": [
2087,
2102
],
"loc": {
"start": {
"line": 79,
"column": 2
},
"end": {
"line": 79,
"column": 17
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "changes",
"range": [
2103,
2110
],
"loc": {
"start": {
"line": 79,
"column": 18
},
"end": {
"line": 79,
"column": 25
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
2112,
2117
],
"loc": {
"start": {
"line": 79,
"column": 27
},
"end": {
"line": 80,
"column": 3
}
}
},
"generator": false,
"expression": false,
"range": [
2102,
2117
],
"loc": {
"start": {
"line": 79,
"column": 17
},
"end": {
"line": 80,
"column": 3
}
}
},
"kind": "method",
"computed": false,
"range": [
2087,
2117
],
"loc": {
"start": {
"line": 79,
"column": 2
},
"end": {
"line": 80,
"column": 3
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Validate Changes\n * @param {Changes} changes A Changes array\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1955,
2084
],
"loc": {
"start": {
"line": 74,
"column": 2
},
"end": {
"line": 78,
"column": 5
}
}
}
],
"static": false
}
],
"range": [
1573,
2119
],
"loc": {
"start": {
"line": 55,
"column": 20
},
"end": {
"line": 81,
"column": 1
}
}
},
"range": [
1553,
2119
],
"loc": {
"start": {
"line": 55,
"column": 0
},
"end": {
"line": 81,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema The name of the schema\n * @property {(Number|String)} version The version of the schema\n * @property {Object} data An object containing the data\n ",
"range": [
40,
343
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name The name of the schema\n * @property {Object} columns An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
"range": [
345,
635
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 15,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
"range": [
637,
822
],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 22,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
"range": [
824,
914
],
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 27,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n * - schema.create\n * - schema.rename\n * - schema.remove\n * - column.create\n * - column.rename\n * - column.remove\n * - column.typechange\n ",
"range": [
916,
1322
],
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A result of the validation containing errors when failed.\n * @typedef {Object} ValidationResult\n ",
"range": [
1325,
1434
],
"loc": {
"start": {
"line": 44,
"column": 1
},
"end": {
"line": 47,
"column": 4
}
}
},
{
"type": "Block",
"value": "*\n * A validator that can be used to validate the following objects:\n * - DataInfo\n * - Schema\n * - Changes\n ",
"range": [
1436,
1552
],
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 54,
"column": 3
}
}
}
],
"__esdoc__pseudo_export": true,
"trailingComments": []
},
"range": [
2121,
2154
],
"loc": {
"start": {
"line": 83,
"column": 0
},
"end": {
"line": 83,
"column": 33
}
},
"leadingComments": null
},
{
"type": "ExportDefaultDeclaration",
"declaration": {
"type": "VariableDeclaration",
"kind": "let",
"loc": {
"start": {
"line": 83,
"column": 0
},
"end": {
"line": 83,
"column": 33
}
},
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "specValidator"
},
"init": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "SpecValidator"
}
}
}
],
"leadingComments": [],
"trailingComments": []
},
"range": [
2121,
2154
],
"loc": {
"start": {
"line": 83,
"column": 0
},
"end": {
"line": 83,
"column": 33
}
}
}
],
"sourceType": "module",
"range": [
0,
2154
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 83,
"column": 33
}
},
"comments": [
{
"type": "Block",
"value": "*\n * A container for data that also includes the schema and version.\n * @typedef {Object} DataInfo\n * @property {String} schema The name of the schema\n * @property {(Number|String)} version The version of the schema\n * @property {Object} data An object containing the data\n ",
"range": [
40,
343
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A schema describing the properties of data.\n * @typedef {Object} Schema\n * @property {String} name The name of the schema\n * @property {Object} columns An object of columns where the key is the unique id for the column and the value is an object of type Column\n ",
"range": [
345,
635
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 15,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A column describing a single property of data.\n * @typedef {Object} Column\n * @property {String} name The name of the column\n * @property {String} type The type of the column\n ",
"range": [
637,
822
],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 22,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * An array of changes containing items of type Change\n * @typedef {Array} Changes\n ",
"range": [
824,
914
],
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 27,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A change indicating a modification to a schema or column.\n * @typedef {Object} Change\n * @property {String} id The id of the schema that this change applies to\n * @property {String} change A string indicating the type of change,\n * this can be any of:\n * - schema.create\n * - schema.rename\n * - schema.remove\n * - column.create\n * - column.rename\n * - column.remove\n * - column.typechange\n ",
"range": [
916,
1322
],
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * A result of the validation containing errors when failed.\n * @typedef {Object} ValidationResult\n ",
"range": [
1325,
1434
],
"loc": {
"start": {
"line": 44,
"column": 1
},
"end": {
"line": 47,
"column": 4
}
}
},
{
"type": "Block",
"value": "*\n * A validator that can be used to validate the following objects:\n * - DataInfo\n * - Schema\n * - Changes\n ",
"range": [
1436,
1552
],
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 54,
"column": 3
}
}
},
{
"type": "Block",
"value": "*\n * Validate a DataInfo object\n * @param {DataInfo} dataInfo A DataInfo object\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1577,
1721
],
"loc": {
"start": {
"line": 56,
"column": 2
},
"end": {
"line": 60,
"column": 5
}
}
},
{
"type": "Block",
"value": "*\n * Validate a Schema\n * @param {Schema} schema A Schema\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1799,
1920
],
"loc": {
"start": {
"line": 66,
"column": 2
},
"end": {
"line": 70,
"column": 5
}
}
},
{
"type": "Block",
"value": "*\n * Validate Changes\n * @param {Changes} changes A Changes array\n * @return {ValidationResult} A ValidationResult\n ",
"range": [
1955,
2084
],
"loc": {
"start": {
"line": 74,
"column": 2
},
"end": {
"line": 78,
"column": 5
}
}
}
]
}
I am not sure why this is happening, hope you know more =)
Decorators become quite wide spread for time annotation or library features deprecation (thanks babel
).
So is it possible to support them in esdoc
.
Currently classes, which contains decorated methods are excluded out of the output.
//wouldn't be included in documentation
class A {
@bar
foo () {
…
}
}
Hello. First of all I want to thank you for this awesome software! It's really useful and easy to use.
Do you think it's possible to support inline docblocks?
/** @type {Number} the progress in percentages */
this.progress = 0
I was hoping to be able to encapsulate modules which are made up of a file which only export a single instance of a class (without the class being exported). Any chance of adding @module
support for better ES6 module export handling? JSDoc handles it this way or this way. I'd love to chip in, just let me know if you'd be willing to accept a pull request if I added a test case for the new tag (and if I'd also need to file a PR for updating the documentation/website). ありがとう!
Example use case:
class Foo {}
/**
* @type Foo
* @module fooSingletonInstance
*/
export const fooSingletonInstance = new Foo();
If config is the following code, excluding is not match.
./src/foo/bar.js
./src/index.js
{
source: "./src",
destination: "./doc",
excludes: ["^foo/"]
}
also config.includes
Is it currently possible to extract types from typescript (specifically using flow types) style annotations when building documentation rather than enforcing extra docblocks? Perhaps there is some plugin support?
If not currently is there any plan to build this support in?
Hi!
I was wondering if grunt support was on the roadmap for this project? For me at least it's a must.
I'm not really sure how complex it is to integrate with grunt, the grunt-jsdoc plugin seems rather complex. If it's simplish, I'd be happy to do it myself.
I think it can be done with the programmatic API, but I can't figure out how that works. If I could get some more info, on the API, I'd be happy to whip up a plugin.
Thanks!
Hello.
The generated document shows a statement to import.
This is a good feature.
But I want to customize this path, can I do so?
This example,
import CodeContractError from "code-contracts/src/CodeContractError.js"
is the path to raw source code. I build with Babel, soimport CodeContractError from "code-contracts/lib/CodeContractError"
is correct. And actually, I want to rewrite it to below:import {CodeContractError} from "code-contracts"
Thanks.
support complex class extends.
class Foo extends Bar(123) {}
class Foo extends mix(Bar, Baz){}
ES6 Classes allow to anonymous.
ClassDeclaration[Yield, Default] :
class BindingIdentifier[?Yield] ClassTail[?Yield]
[+Default] class ClassTail[?Yield] // <= export default class { }
ClassTail[Yield] :
ClassHeritage[?Yield]opt { ClassBody[?Yield]opt }
esdoc fail to parse anonymous class and throw error.
I'v create example repository : azu/esdoc-no-class-name-issue
// anonymous class
export default class {
constructor(){
this.description = "this is example class";
}
}
parse error:
$ npm run doc
> [email protected] doc /Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue
> esdoc -c esdoc.json
/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/ESDoc.js:378
throw _iteratorError5;
^
TypeError: Cannot read property 'name' of null
at ClassDoc.name (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Doc/ClassDoc.js:70:39)
at ClassDoc._apply (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Doc/AbstractDoc.js:68:20)
at ClassDoc._apply (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Doc/ClassDoc.js:48:71)
at ClassDoc.AbstractDoc (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Doc/AbstractDoc.js:54:10)
at new ClassDoc (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Doc/ClassDoc.js:34:20)
at DocFactory._createDoc (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Factory/DocFactory.js:388:14)
at DocFactory._traverseComments (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Factory/DocFactory.js:318:24)
at DocFactory.push (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Factory/DocFactory.js:206:26)
at Controller.<anonymous> (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/ESDoc.js:411:17)
at Controller.enter (/Users/azu/.ghq/github.com/azu/esdoc-no-class-name-issue/node_modules/esdoc/out/src/Util/ASTUtil.js:42:20)
I suggest that esdoc throw warning instead of error.
Hello!
esdoc is the great tool!
But it seems frozen during about 6 seconds when opened as the local file.
I guess the cause is this.
It's waiting for a timeout of opening file://fonts.googleapis.com
.
So I think we can use https://fonts.googleapis.com/css?family=Roboto:400,300,700
instead.
Thanks.
GET file://fonts.googleapis.com/css?family=Roboto:400,300,700 net::ERR_FILE_NOT_FOUND
v0.1.1
v0.12.2
v2.8.4
Just wanted to say THANKYOU this project is great!
Quick question. What is the best way to write a typedef, or document a callback whose signature is used in several places?
export function test({foo, bar}) {
}
In this code, ESDoc generates a documentation as below.
Does ESDoc have the way to write a documentation for destructuring arguments?
like this:
/**
* test1
* @param {object} args
* @property {string} foo
* @property {string} bar
*/
export function test1({foo, bar}) {
}
Thanks.
Looks like only one @example
tag is rendered into HTML.
It also looks like esdoc doesn't do anything with optional <caption>
tag.
Hey there, I know you don't currently support ES6+ (or ES7) features, since they're still under development/review. However, I've run into issues where using these new features causes esdoc to fail silently. Would you be amenable to a pull request to opt-into, or to ignore, ES6+ features, so that other files can still be processed? I've looked into this already, and it may also require a fix to espree (which I would submit prior to any PR for this project).
Thanks,
Murray
Is there a way to force an export function to be treated as a class?
Example:
export function AudioExt(session){
vs.
export class Pluggy {
Classes have their own section while the functions are all grouped together.
Is it possible to change this?
When I separate class definition and export statement, class definition doesn't show in Identifier.
/**
* this is MyClass.
*/
export default class MyClass {
/**
* @param {number} param this is param.
* @return {number} this is return.
*/
method(param){}
}
/**
* this is MyClass.
*/
class MyClass {
/**
* @param {number} param this is param.
* @return {number} this is return.
*/
method(param){}
}
export default MyClass;
Do you have a plan that support this case?
https://esdiscuss.org/topic/es7-property-initializers
export class Counter extends React.Component {
static propTypes = {
initialCount: React.PropTypes.number
};
...
Similar to #36, esdoc should at least silently ignore unexpected syntax and continue generating documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.