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

Add support for JSDoc descriptions from object types #3

Merged
merged 5 commits into from
Jan 29, 2024

Conversation

daniel-chambers
Copy link
Collaborator

@daniel-chambers daniel-chambers commented Jan 25, 2024

Note: This PR is stacked on #2 and will be rebased on main when that PR merges. Done.

JIRA: NDC-345

This PR adds support for JSDoc descriptions on object types. We currently support picking up descriptions from function definitions and function arguments, but object types and their properties were missed.

For example, we now support:

/**
 * My object type is the best object type.
 * You should make all object types like mine.
 */
type MyObjType = {
  /** This is a good property */
  propA: string
}

Unit tests have been added to check gathering of descriptions from functions and from types.

Base automatically changed from auto-parallel to main January 25, 2024 04:08
Copy link

@sordina sordina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @daniel-chambers I was slightly confused why some of the test output keys were now quoted but I guess it was just updating with the new output, and it doesn't make any difference anyway.

@@ -5,6 +5,7 @@ This changelog documents the changes between release versions.
Changes to be included in the next upcoming release

- Add support for parallel execution of readonly functions ([#2](https://github.com/hasura/ndc-nodejs-lambda/pull/2))
- Add support for JSDoc descriptions from object types ([#3](https://github.com/hasura/ndc-nodejs-lambda/pull/3))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +199 to +203
Descriptions are collected for:
* Functions
* Function parameters
* Types
* Type properties
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@daniel-chambers daniel-chambers merged commit e9bc4a4 into main Jan 29, 2024
4 checks passed
@daniel-chambers daniel-chambers deleted the descriptions branch January 29, 2024 21:57
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

Successfully merging this pull request may close these issues.

2 participants