Skip to content

docs: add JSDocs for top level API objects #140

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

Merged
merged 1 commit into from
May 12, 2020

Conversation

lance
Copy link
Member

@lance lance commented May 9, 2020

This commit adds JSDoc documentation to the CloudEvent and HTTPReceiver
objects exposed by the API when using the top level imports.

Ref: #130
Ref: #9

Creating as a draft PR because I'd still like to add docs generation for hosting on GitHub pages.

Signed-off-by: Lance Ball [email protected]

@lance lance added type/enhancement New feature or request module/docs Module documentation changes labels May 9, 2020
@lance lance requested review from grant, fabiojose and helio-frota May 9, 2020 02:52
@lance lance self-assigned this May 9, 2020
@lance lance force-pushed the 130-jsdoc-toplevel branch from 2703cf6 to 2bcfc52 Compare May 9, 2020 02:57
@lance
Copy link
Member Author

lance commented May 9, 2020

I didn't mark this as "Fixes" for #130 since I think we should discuss what the actual exposed API should be before we determine what constitutes acceptable documentation for end users. I think once a version agnostic emitter is available, that should be exposed at the top level as well, and everything else should be removed from the public facing API. What else besides the CloudEvent and HTTPEmitter and an HTTPReceiver is needed for CloudEvent producers and consumers?

@lance
Copy link
Member Author

lance commented May 9, 2020

I've added automatic doc generation. You can see how it will look on my fork here: http://lanceball.com/sdk-javascript/

@lance lance force-pushed the 130-jsdoc-toplevel branch from 4ff8e35 to b26a172 Compare May 11, 2020 14:50
Copy link
Contributor

@helio-frota helio-frota left a comment

Choose a reason for hiding this comment

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

@lance I found only a few minor typos, some phrases and paragraphs are terminated with period and others don`t.

This commit add JSDoc documentation to the CloudEvent and HTTPReceiver
objects exposed by the API when using the top level imports, specifically
`CloudEvent` and `HTTPReceiver`.

This adds a `generate-docs` npm script to generate site and API documentation
for GitHub pages in `./docs`.

Signed-off-by: Lance Ball <[email protected]>
@lance lance force-pushed the 130-jsdoc-toplevel branch from 986e2b2 to 18fd424 Compare May 11, 2020 19:30
@lance lance marked this pull request as ready for review May 11, 2020 19:30
@lance
Copy link
Member Author

lance commented May 11, 2020

@helio-frota changes applied. Would you mind refreshing your review? Thanks.

@helio-frota helio-frota self-requested a review May 12, 2020 12:13
/**
* Adds an extension attribute to this CloudEvent
* @see https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes
* @param {*} key the name of the exteneion attribute
Copy link
Contributor

Choose a reason for hiding this comment

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

@lance seems the typo was fixed in code but the generated docs needs to be updated again ?

Copy link
Contributor

Choose a reason for hiding this comment

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

not a blocker since it will be updated along time anyway 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh shoot - thanks. I'll update before landing this.

@lance lance merged commit b283583 into cloudevents:master May 12, 2020
@lance lance deleted the 130-jsdoc-toplevel branch May 12, 2020 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/docs Module documentation changes type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants