asyncapi / generator

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!
https://asyncapi.com/docs/tools/generator
Apache License 2.0
759 stars 211 forks source link

Enhance API docs with information about results of code generation with generateFromString using entrypoint #507

Open derberg opened 3 years ago

derberg commented 3 years ago

Reason/Context

The problem is described here https://github.com/asyncapi/playground/pull/79. It must be clear that returned data is not content but an object with content and metadata + what is this metadata, and that it is only with React renderer.

Description

Probably JSDoc must be only updated. Of course, some additional section in the readme would be also welcomed 😄

jonaslagoni commented 3 years ago

Quick note it might actually not be a feature but a bug. Think the generateFromString should always return the content as is regardless of whether it is a Nunjucks or React template.

If it is the case remember to change the playground afterwards.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

derberg commented 2 years ago

it is still valid, not JSDoc fix but bug fix but still easy to do. No need to followup with playground as it is not used anymore

starlightknown commented 2 years ago

Hi, I would like to take on this issue. A little guidance might be needed, I saw the playground PR and got some context.

derberg commented 2 years ago

I think it would be enough to just extend JSDoc of this function and explain that if entrypoint option is passed then the following object is returned => https://github.com/asyncapi/generator-react-sdk/blob/master/src/renderer/template.ts#L80

@magicmatatjahu @jonaslagoni thoughts?

@starlightknown did you edit JSDoc before? do you need support in explaining how to make changes locally and test if they work as expected?

starlightknown commented 2 years ago

No, I haven't done it before and yes I'll need some help please

derberg commented 2 years ago

@starlightknown happy to help, no worries. Let's just make sure folks @magicmatatjahu @jonaslagoni agree with the fix that needs to be applied

jonaslagoni commented 2 years ago

Sounds good to me 👍

derberg commented 2 years ago

@starlightknown looks like this one is ready to go, still interested?

lumenCodes commented 1 year ago

Hello @derberg please I want to tweet about this issue so first-time contributors can check it out.

derberg commented 1 year ago

@lumenCodes feel free 👍🏼

lumenCodes commented 1 year ago

Done

Jagrutiti commented 1 year ago

Hey,

Is this still issue open to work?

There are discussions. But no PRs.

Jagrutiti commented 1 year ago

In the description it is written:

Probably JSDoc must be only updated

Could you share the link of JSDoc?

derberg commented 1 year ago

@Jagrutiti hey, this is still valid. JSDoc is part of the code, and then API.md file is generated from it.

This is a return definition that needs to be more specific -> https://github.com/asyncapi/generator/blob/master/lib/generator.js#L256. and https://github.com/asyncapi/generator/blob/master/lib/generator.js#L164

so basically in case entrypoint is used and output flag is set to string then generator instead of generating folders and files on a drive, it returns object like -> https://github.com/asyncapi/generator-react-sdk/blob/master/src/renderer/template.ts#L80 so generation result must be extracted from content property.

I personally do not know how to best do it with JSDoc, you need to have a look at their docs. It might be something like @return {Promise<TemplateRenderResult|undefined>} with some additional explanation. But TemplateRenderResult type would have to be there too:

    /**
     * @typedef TemplateRenderMetadata
     * @type {object}
     * @property {string} fileName
     * @property {string} permissions
     */

    /**
     * @typedef TemplateRenderResult
     * @type {object}
     * @property {string} content
     * @property {TemplateRenderMetadata} metadata
     */

@jonaslagoni any better suggestions?

jonaslagoni commented 1 year ago

Not really unless we want to convert the entire project into typescript 😄 So sounds good 👍

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

chinma-yyy commented 1 year ago

Hey @derberg Could you once review the PR?

derberg commented 1 year ago

unless we want to convert the entire project into typescript

burn 😛

Could you once review the PR?

on it, sorry for delay 🙏🏼

github-actions[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

lmgyuan commented 5 months ago

Can I take on this issue?

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

derberg commented 1 month ago

@lmgyuan you can take up this one if you want