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

JSDoc documentation versus documentation in *.d.ts #10673

Closed
papb opened this issue Mar 31, 2019 · 8 comments · Fixed by #13914
Closed

JSDoc documentation versus documentation in *.d.ts #10673

papb opened this issue Mar 31, 2019 · 8 comments · Fixed by #13914
Labels
status: in discussion For issues and PRs. Community and maintainers are discussing the applicability of the issue. type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference. type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Comments

@papb
Copy link
Member

papb commented Mar 31, 2019

Is it intended that the two parameter documentations below aren't the same?

* @param {Object} attributes An object, where each attribute is a column of the table. See {@link Model.init}

* @param attributes An object, where each attribute is a column of the table. Each column can be either a
* DataType, a string or a type-description object, with the properties described below:

Also, since now we have duplicated documentation on the source files and on .d.ts files, is there a concrete way to prevent documentation from being updated only in one place?

Pinging @SimonSchick since I know you're highly involved in the typescript things in Sequelize. Thanks for looking!

@SimonSchick
Copy link
Contributor

tl;dr the typings used to be separate, so documentation was duplicated in many places.
I hope we can eventually use TS for sequelize itself and/or generate documentation entirely from the type definitions and make it a single point of truth as the typings are subjectively better documentation than the current jsdoc in the source.

@papb
Copy link
Member Author

papb commented Mar 31, 2019

@SimonSchick - I see. Thanks for the fast response 😁 While sequelize itself doesn't use TS, do you know any tool to generate documentation from *.d.ts files?

Also, is it possible to use syntax similar to {@link} in the *.d.ts documentation? (I am very new to TS, sorry if it is a trivial question). If not, what is a good strategy when documenting to replace things like {@link} in the *.d.ts documentation?

@SimonSchick
Copy link
Contributor

I don't think that @link works very well in TS but you're welcome to try.

As for generating documentation, I worked with some generators before but their capabilities were extremely limited, you are welcome to make suggestions.

@SimonSchick SimonSchick added status: in discussion For issues and PRs. Community and maintainers are discussing the applicability of the issue. type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference. type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. labels Mar 31, 2019
@papb
Copy link
Member Author

papb commented Mar 31, 2019

I see. I've asked a question in typedoc to see if it would be possible to use that. Other than that, I have no idea...

Maybe we will have to put up with duplicated docs while sequelize doesn't move to TS. It's not ideal but I don't think it's that terrible either...

@papb
Copy link
Member Author

papb commented Apr 1, 2019

@SimonSchick - Apparently it is possible to use typedoc. I do not have the time to try it out though... Just letting you know.

@ALiangLiang
Copy link
Contributor

ALiangLiang commented Apr 2, 2019

I just tried to use this generator.

$ typedoc --exclude node_modules/ --includeDeclarations --out typedoc/ --readme README.md --name Sequelize types/lib

@SimonSchick
Copy link
Contributor

Ultimately this is up to @sushantdhiman as this would drastically alter the current documentation and might make it harder for non TS users to read, we could co-host a type-doc version but that's not my call 😄

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion For issues and PRs. Community and maintainers are discussing the applicability of the issue. type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference. type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants