From 6812de6a77ca93b2067e1ef12f683c8be38f3491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Tue, 4 Aug 2015 22:04:15 +0200 Subject: [PATCH] Upgrade JSDoc to 3.3.2 and remove obsoleted plugins --- config/jsdoc/api/conf.json | 2 - config/jsdoc/api/plugins/inheritdoc.js | 109 ------------------------- config/jsdoc/api/plugins/interface.js | 25 ------ package.json | 2 +- 4 files changed, 1 insertion(+), 137 deletions(-) delete mode 100644 config/jsdoc/api/plugins/inheritdoc.js delete mode 100644 config/jsdoc/api/plugins/interface.js diff --git a/config/jsdoc/api/conf.json b/config/jsdoc/api/conf.json index 9560ae8398..4b202607a5 100644 --- a/config/jsdoc/api/conf.json +++ b/config/jsdoc/api/conf.json @@ -17,8 +17,6 @@ }, "plugins": [ "node_modules/jsdoc/plugins/markdown", - "config/jsdoc/api/plugins/inheritdoc", - "config/jsdoc/api/plugins/interface", "config/jsdoc/api/plugins/typedefs", "config/jsdoc/api/plugins/events", "config/jsdoc/api/plugins/observable", diff --git a/config/jsdoc/api/plugins/inheritdoc.js b/config/jsdoc/api/plugins/inheritdoc.js deleted file mode 100644 index d0026b347c..0000000000 --- a/config/jsdoc/api/plugins/inheritdoc.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This is a hack to prevent inheritDoc tags from entirely removing - * documentation of the method that inherits the documentation. - * - * TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53 - * is addressed. - */ - - -exports.defineTags = function(dictionary) { - dictionary.defineTag('inheritDoc', { - mustHaveValue: false, - canHaveType: false, - canHaveName: false, - onTagged: function(doclet, tag) { - doclet.inheritdoc = true; - } - }); -}; - - -var lookup = {}; -var incompleteByClass = {}; -var keepKeys = ['comment', 'meta', 'name', 'memberof', 'longname', 'augment', - 'stability']; - -exports.handlers = { - - newDoclet: function(e) { - var doclet = e.doclet; - var incompletes; - if (!(doclet.longname in lookup)) { - lookup[doclet.longname] = []; - } - lookup[doclet.longname].push(doclet); - if (doclet.inheritdoc) { - if (!(doclet.memberof in incompleteByClass)) { - incompleteByClass[doclet.memberof] = []; - } - incompletes = incompleteByClass[doclet.memberof]; - if (incompletes.indexOf(doclet.name) == -1) { - incompletes.push(doclet.name); - } - } - }, - - parseComplete: function(e) { - var ancestors, candidate, candidates, doclet, i, j, k, l, key; - var incompleteDoclet, stability, incomplete, incompletes; - var doclets = e.doclets; - for (i = doclets.length - 1; i >= 0; --i) { - doclet = doclets[i]; - if (doclet.augments) { - ancestors = [].concat(doclet.augments); - } - incompletes = incompleteByClass[doclet.longname]; - if (ancestors && incompletes) { - // collect ancestors from the whole hierarchy - for (j = 0; j < ancestors.length; ++j) { - candidates = lookup[ancestors[j]]; - if (candidates) { - for (k = candidates.length - 1; k >= 0; --k) { - candidate = candidates[k]; - if (candidate.augments) { - ancestors = ancestors.concat(candidate.augments); - } - } - } - } - // walk through all inheritDoc members - for (j = incompletes.length - 1; j >= 0; --j) { - incomplete = incompletes[j]; - candidates = lookup[doclet.longname + '#' + incomplete]; - if (candidates) { - // get the incomplete doclet that needs to be augmented - for (k = candidates.length - 1; k >= 0; --k) { - incompleteDoclet = candidates[k]; - if (incompleteDoclet.inheritdoc) { - break; - } - } - } - // find the documented ancestor - for (k = ancestors.length - 1; k >= 0; --k) { - candidates = lookup[ancestors[k] + '#' + incomplete]; - if (candidates) { - for (l = candidates.length - 1; l >= 0; --l) { - candidate = candidates[l]; - if (candidate && !candidate.inheritdoc) { - stability = candidate.stability || incompleteDoclet.stability; - if (stability) { - incompleteDoclet.stability = stability; - for (key in candidate) { - if (candidate.hasOwnProperty(key) && - keepKeys.indexOf(key) == -1) { - incompleteDoclet[key] = candidate[key]; - } - } - } - } - } - } - } - } - } - } - } - -}; \ No newline at end of file diff --git a/config/jsdoc/api/plugins/interface.js b/config/jsdoc/api/plugins/interface.js deleted file mode 100644 index 7569ba83c9..0000000000 --- a/config/jsdoc/api/plugins/interface.js +++ /dev/null @@ -1,25 +0,0 @@ -exports.defineTags = function(dictionary) { - - var classTag = dictionary.lookUp('class'); - dictionary.defineTag('interface', { - mustHaveValue: false, - onTagged: function(doclet, tag) { - classTag.onTagged.apply(this, arguments); - doclet.interface = true; - } - }); - - var augmentsTag = dictionary.lookUp('augments'); - dictionary.defineTag('implements', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - tag.value = tag.value.match(/^\{?([^\}]*)\}?$/)[1]; - augmentsTag.onTagged.apply(this, arguments); - if (!doclet.implements) { - doclet.implements = []; - } - doclet.implements.push(tag.value); - } - }); - -}; diff --git a/package.json b/package.json index 00be9c7fe6..2d2a55653c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "glob": "5.0.3", "graceful-fs": "3.0.2", "handlebars": "3.0.1", - "jsdoc": "3.3.0-alpha9", + "jsdoc": "3.3.2", "marked": "0.3.3", "metalsmith": "1.6.0", "metalsmith-templates": "0.7.0",