Skip to content

Commit

Permalink
feat(unexported): split to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Feb 19, 2017
1 parent f28205a commit 5699525
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 46 deletions.
6 changes: 4 additions & 2 deletions src/ESDoc.js
Expand Up @@ -87,6 +87,10 @@ export default class ESDoc {
this._generateForTest(config, results, asts);
}

for (const tag of results) {
if (tag.export === false) tag.ignore = true;
}

results = Plugin.onHandleTag(results);

try {
Expand Down Expand Up @@ -145,8 +149,6 @@ export default class ESDoc {

if (!config.excludes) config.excludes = ['\\.config\\.(js|es6)$'];

if (!('unexportIdentifier' in config)) config.unexportIdentifier = false;

if (!('undocumentIdentifier' in config)) config.undocumentIdentifier = true;

if (!config.index) config.index = './README.md';
Expand Down
21 changes: 1 addition & 20 deletions src/Publisher/Builder/DocResolver.js
Expand Up @@ -25,9 +25,6 @@ export default class DocResolver {
console.log('resolve: necessary');
this._resolveNecessary();

console.log('resolve: unexported identifier');
this._resolveUnexportIdentifier();

console.log('resolve: undocument identifier');
this._resolveUndocumentIdentifier();

Expand Down Expand Up @@ -68,22 +65,6 @@ export default class DocResolver {
this._data.__RESOLVED_IGNORE__ = true;
}

/**
* resolve unexport identifier doc.
* doc is added ignore property that is not exported.
* @private
*/
_resolveUnexportIdentifier() {
if (this._data.__RESOLVED_UNEXPORT_IDENTIFIER__) return;

const config = this._builder._config;
if (!config.unexportIdentifier) {
this._data({export: false}).update({ignore: true});
}

this._data.__RESOLVED_UNEXPORT_IDENTIFIER__ = true;
}

/**
* resolve undocument identifier doc.
* doc is added ignore property that does not have document tag.
Expand Down Expand Up @@ -343,7 +324,7 @@ export default class DocResolver {
let childDoc = builder._find({longname: childName})[0];
if (!childDoc) continue;
if (!childDoc.ignore && childDoc.export) {
doc.export = true;
doc.ignore = false;
return doc;
}
}
Expand Down
8 changes: 0 additions & 8 deletions test/fixture/config/esdoc-unexportIdentifier.json

This file was deleted.

16 changes: 0 additions & 16 deletions test/src/ConfigTest/UnexportIdentifierTest.js

This file was deleted.

0 comments on commit 5699525

Please sign in to comment.