-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
feat: Added types for typescript #116
Conversation
I am unsure whether it is required to have a |
@jonaslagoni Great job! I have only one simple question. Why types are generated inside |
@jonaslagoni Sorry 😅 |
Ahh! Makes sense 😄
Yea should probably be located in the root now that I think about it, since its generated and has no manual code added. I'll change it. |
@jonaslagoni I fetched your PR, run
Also I think that people want also types for Models, so this PR must include exported classes in module or with Those errors can be fixed by follow task :) [TSD-JSDoc] utils.js:258:0 Failed to find parent of doclet 'utils.parseUrlVariables' using memberof 'utils', this is likely due to invalid JSDoc.
[TSD-JSDoc] utils.js:268:0 Failed to find parent of doclet 'utils.getMissingProps' using memberof 'utils', this is likely due to invalid JSDoc.
[TSD-JSDoc] utils.js:290:0 Failed to find parent of doclet 'utils.groupValidationErrors' using memberof 'utils', this is likely due to invalid JSDoc. By the way, great job! |
Thanks for the review 👍 I had skipped the step of actually compiling my test project as well which lead to some new problems as well as the one you noticed. I actually ignored it since I thought it was my compile options which did it 😅 Sorry about that.
Ohh! Yea that worked perfectly 😄 So I managed to get everything generated under the module We might want to think about adding a test for the CI which creates/uses a typescript project and includes the parser and tries to compile it. Otherwise we end up with a faulty
The warnings has also been handled. @magicmatatjahu everything checks out in my end now, can you review it once more? 😄 |
@jonaslagoni I tried again pack and load in another project, and everything works as aspected! I noticed yet, that project only exports from index: parse,
parseFromUrl,
registerSchemaParser,
ParserError,
AsyncAPIDocument, so user have a types for models, but only can create Also, issue for update About tests, good idea! But I don't know what it might look like. It should be little project, only with imports, so contributor will have to add a new type each time it appears. Very good job! From my side it can be merged. |
In which context or use-case would they want to create their own instance of
This could be as simple as just a compile test, if the parser can be imported and the project can be compiled all good. Since most common error we can make is a faulty jsdoc which renders the project uncompilable in typescript. |
I just think so. As a developer, I don't like having a closed door if I need custom logic 😄 |
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 tested it in small ts-node app and it works! Great job.
@jonaslagoni yo man, you have come conflicts there 😉 |
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.
Great stuff 👏
Solved :) |
@jonaslagoni linter fails with some error in |
Fixed right before you saw it too 😄 |
@jonaslagoni did you think maybe how we can make sure it works overtime? how to test it? I'm thinking about it as this is something we need to solve for the browser bundle generation and maybe this could be somehow combined, at least the mechanism behind it |
@derberg wrote something about it earlier. We could catch many of the errors by just using the |
@jonaslagoni so it could be a react project in typescript that parses dummy spec file. We would just add also a simple script with https://github.com/puppeteer/puppeteer that would make sure there are no console errors and some basic elements are visible. So one project to fix both test challenges? |
@jonaslagoni I created an issue for this #130 |
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 approve, and looking that @magicmatatjahu and @fmvilas approved before merge conflicts, we can merge now
@jonaslagoni before I merge, I noticed you're adding now |
@derberg done 👍 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
well done mate!
🎉 This PR is included in version 0.28.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
types
script to generate the types filerelease
github actions to re-generate the types on each release.Related issue(s)
Fixes #93