Skip to content
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

How to group ES2015 modules? #284

Open
alystair opened this issue Sep 3, 2022 · 3 comments
Open

How to group ES2015 modules? #284

alystair opened this issue Sep 3, 2022 · 3 comments
Labels
more info More info required to reproduce

Comments

@alystair
Copy link

alystair commented Sep 3, 2022

I'm in the process of converting a major project from a single monstrous JS file using a namespaced object to ES2015, and as a result it totally broke JSDoc generation.

This is my current npm run script (I've excluded a large list of custom partials for readability)
npx jsdoc-to-markdown -c jsdoc.conf --private --heading-depth 1 --files src/core/init.mjs > docs/reference-core.html

init.mjs is my entry point and pretty much looks like this

import foo from './foo.mjs';
import bar from './bar.mjs';
const app = {
  foo,
  bar,
};

globalThis.app = app;
export default app;

Obviously generating documentation for any imported module makes no sense when using 3rd party libraries, is there a way to document which imported modules are part of the project so their documentation is automatically pulled in?

What's the secret jsdoc recipe to generate a single page of documentation for app foo bar etc...? I used to @namespace religiously which worked perfectly for a large object but nothing seems to be pulled in...

@alystair
Copy link
Author

alystair commented Sep 4, 2022

OK so I figured out I needed to actually provide the entire collection of .mjs/js files... but I'm still having a hard time figuring out how to group these modules in a parent/child relationship like I did natively with a single object containing all the 'modules'.

@memberof app didn't work, naming the module app/foo didn't either. Suggestions welcome!

@alystair alystair changed the title How to generate documentation for internal ES2015 imports? How to group ES2015 modules? Sep 4, 2022
@alystair
Copy link
Author

alystair commented Sep 4, 2022

if I use @namespace app.foo it now moves to the correct heading, but now all exports are missing...

@75lb
Copy link
Member

75lb commented Aug 26, 2024

I'm not 100% certain what you're trying to achieve so can't yet give you a precise answer on how to achieve it.. Could you post a gist or similar of actual source code along with the command I should run to see your issue? I'm guessing you will need to make use of @alias..

@75lb 75lb added the more info More info required to reproduce label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info More info required to reproduce
Development

No branches or pull requests

2 participants