Skip to content

Only document exported bindings #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arv opened this issue Aug 27, 2016 · 1 comment
Closed

Only document exported bindings #515

arv opened this issue Aug 27, 2016 · 1 comment

Comments

@arv
Copy link
Contributor

arv commented Aug 27, 2016

My use case is that we have an index.js that forwards a bunch of bindings.

export {default as A} from './a.js';
export {foo, bar} from './baz.js';

Then a.js and baz.js might depend on other files that have different exported bindings.

What we want is to generate documentation for what is in index.js. For this --shallow does not work because we want to keep the jsdoc comments close to the binding declarations (and keeping methods etc in sync would be impossible). Having --shallow=false does not work either because then all annotated bindings gets exposed, even if they are not exported from index.js.

One way to achieve this might be to generate the json for everything and then manipulate that but it seems like this would be a valuable mode to expose.

@arv
Copy link
Contributor Author

arv commented Sep 5, 2016

Thinking more about this.

Today the input/dependency.js generates a list of all files reachable by require/ModuleSpecifier. Then the code is traversed using an extractor. In this case it seem like this model is not a good fit and it would be better to let the extractor also determine which files to process.

@tmcw I would like your input on this topic since you have a better understanding of how everything interacts.

arv added a commit to arv/documentation that referenced this issue Sep 8, 2016
Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes documentationjs#515
arv added a commit to arv/documentation that referenced this issue Sep 8, 2016
Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes documentationjs#515
@tmcw tmcw closed this as completed in #533 Sep 9, 2016
tmcw pushed a commit that referenced this issue Sep 9, 2016
* Change document-exported to traverse the code

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes #515

* Move parseToAst to its own module

* Skip non export declarations for speed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant