generator
generator copied to clipboard
Introduce API generation for components
now we have: https://github.com/asyncapi/generator/blob/master/apps/react-sdk/API.md#functions with basic components and nothing else
but more and more components will get into https://github.com/asyncapi/generator/tree/master/packages/components/src/components
- we need a simple solution connected with
npm run generate:assetsthat will generate one singleAPI.mdwith list of all components - maybe we should move
File,IndentandTextcomponents out fromreact-sdkand release them as part of@asyncapi/components?
Hi @derberg I’d love to take this up. I can create a script that scans packages/components/src/components and auto-generates an API.md with all components, hooked into npm run generate:assets. I can also look into moving File, Indent, and Text to @asyncapi/components if that makes sense. Please let me know if you’d like me to proceed this way.
According to me for now we should focus on getting docs up for components.
I don't think we should instantly move File, Indent and Text components out from react-sdk because it is implemented carefully in TS with nice logic of Transpile and Render process while our @asyncapi/generator-components is in JS and also more towards experimental phase still.
It is fine for now if we have 2 different libraries because main goal of react-sdk is provide basic components and @asyncapi/generator-components is like a framework of react-sdk which provides 1 extra layer of abstraction.
@derberg wdyt 🤔?
also more towards experimental phase still
yup, this is an argument that plays well here.
so for now we can try with just @asyncapi/generator-components API generation as it is now, with what we have there now
@harshhgithub if you are interested you can work on the issue. Please read https://github.com/asyncapi/generator/blob/master/CONTRIBUTING.md and don't create PR directly just drop a comment that you are working on it or not, easy for maintainers to track issues.
As I understand it, there should be an API.md that contains unified documentation for components from both
-
./apps/react-sdk/src/components -
./packages/components/src/components
PR https://github.com/asyncapi/generator/pull/1767 attempted to utilize JSDoc comments from ./packages/components/src/components, while also addressing https://github.com/asyncapi/generator/issues/1724 for JSDocs de-duplication, but since jsdoc-to-markdown does not understand the inline ? optional syntax, I either have to rewrite JSDoc comments or migrate the project to TypeScript.
As rewriting JSDocs to a plain object map with @property {string} [returnType] to mark optional properties would be a significant step backward, and the source code of @asyncapi/generator-components is leaning toward migration to TypeScript anyway, I find this a good occasion to rewrite @asyncapi/generator-components in TypeScript, which appears to immediately resolve both https://github.com/asyncapi/generator/issues/1656 and https://github.com/asyncapi/generator/issues/1724.
Would rewriting @asyncapi/generator-components in TypeScript to simultaneously resolve both https://github.com/asyncapi/generator/issues/1656 and https://github.com/asyncapi/generator/issues/1724 be acceptable?
@derberg @Adi-204, what do you think?