-
-
Notifications
You must be signed in to change notification settings - Fork 920
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
docs: add @since
tags to all methods
#1337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like this.
Please also add a new test case to: https://github.com/faker-js/faker/blob/main/test/scripts/apidoc/signature.example.ts
Also not sure whether there should be an empty line after the @examples
and before @since
.
There definitely should be IMO. Looks a lot better with all topics grouped. Much easier to scan (as a human) as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add spaces around the @since
tag so it aligns with the other tags.
Sorry my typescript is not really up to this. Maybe someone else can help me with the tests |
19d2716
to
f0fa6b8
Compare
added the newlines and made the other suggested changes. |
f0fa6b8
to
2f4f716
Compare
2f4f716
to
a98e3dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will address the test later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool 👍
Count me as approved when all the missing requested/required tasks are finished
Codecov Report
@@ Coverage Diff @@
## main #1337 +/- ##
========================================
Coverage 99.63% 99.63%
========================================
Files 2163 2163
Lines 240701 241242 +541
Branches 1017 1018 +1
========================================
+ Hits 239817 240359 +542
+ Misses 863 862 -1
Partials 21 21
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faker.fake and faker.unique are missing the @since
tags.
The @since
tags won't be picked up for the color module.
I'm not sure why.
The color methods have multiple signatures. You have to add the |
In general it seems its only reading the JSDoc for the last version of a method with multiple signatures like |
I think the last one is enough. |
Depends on whether you want to show this to the user who is currently using faker in an IDE or if you only want to annotate this data to generate better fakerjs.dev docs. If first, then you need to add it to all JSDocs |
i agree maybe all is better. will manually fix the ones in color |
@Shinigami92 how can i run those tests locally to make sure I caught everything? |
As easy as: |
thanks, tests now run green |
fixed those two issues |
@since
tags to all methods
Following on from discussion in #1241 i added
@since
jsdoc tags to all existing public methods, and exposed this in the documentation:This is a one-off large diff for this initial integration, in future it would just be necessary to add
@since
tags for any newly added methods.