-
-
Notifications
You must be signed in to change notification settings - Fork 148
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: add new convert
command to CLI
#188
Conversation
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.
This is looking great, Peter! 🙌
Left a few comments where you can improve the code. If I'm not mistaken, this should already work if you try in your machine 🎉
Adding `flags` when parsing `Convert` class to avoid using `Convert.flags` in the rest of the file. Co-authored-by: Fran Méndez <fmvilas@gmail.com>
Using an object as 3rd argument for `convert()` Co-authored-by: Fran Méndez <fmvilas@gmail.com>
Removing `Convert.x.x` notation Co-authored-by: Fran Méndez <fmvilas@gmail.com>
Removing one more `Convert.x.x` Co-authored-by: Fran Méndez <fmvilas@gmail.com>
Printing the content of `convertedFile` properly Co-authored-by: Fran Méndez <fmvilas@gmail.com>
@fmvilas All requested changes applied and seem to be working fine 👍 I think we're almost ready to start testing the |
@Souvikns I wonder if you have any clue about an error I'm getting when passing the However, when the In order to solve this issue I've been trying to import the flags from Do you know if there is something missing or that I'm not taking into consideration? Thank you!! :) |
@magicmatatjahu @fmvilas I've been testing the
So, my questions about this flag:
What do you think, guys? |
@peter-rr can you confirm where you are seeing this error i.e. in your development environment or production. Now there is an issue in production where we are getting a warning, the CLI works fine but still throws a warning. You can see #192 for full details. We thought #201 would fix the issue but that is not the case currently I have been working on #203 to migrate oclif to the latest version. |
@Souvikns Yeap, I see both errors in my development environment updated with the latest changes from production. Maybe I'm missing some package or plugin needed, not sure 🤔
Do you mean you didn't get any of those errors when running the command on my branch?
Then I think I should wait until #203 is merged so I can test my branch with the latest oclif version and check if those errors still persist. I'll let you know :) |
Yeah, I opened your PR in my local setup. Do an |
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.
Awesome, but I have some insight :)
Still getting the same errors after applying that change. I guess there is something I'm doing wrong or not taking into account 🤔 |
@@ -0,0 +1,2 @@ | |||
declare module '@asyncapi/converter'; |
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.
declare module '@asyncapi/converter'; | |
declare module '@asyncapi/converter' { | |
export async function convert(spec: string, targetVersion: string, options: any): Promise<any> | |
} |
@peter-rr try writing the module as per your needs, I am just giving an example for convert
do this for @asyncapi/spec
as well.
You can take some inspiration from https://github.com/asyncapi/server-api/blob/master/src/server-api.d.ts
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.
Please propagate my changes. There's problem with ts-node
and how exactly it reads the custom typings from external modules. We should move to the Jest and then it will be easy to handle by custom jest transpiler. It's not that important if we have defined types globally or skip them, let's not make our job harder because types are not important here as we know how the package works underneath anyway (and its API).
Propagate changes and then fix tests, because all fail.
Fix problem with '@asyncapi/converter' external module Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fix problem with '@asyncapi/specs' external module Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
Great :) Problems related to external modules are solved now and I'm trying to fix all the current failing tests. They are only 4 at this moment 💪 |
Getting 'Command' class from 'base.ts' and not from '@oclif/core' Co-authored-by: souvik <souvikde.ns@gmail.com>
@Souvikns @magicmatatjahu |
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.
Wow 🤩 looks good, wait for @magicmatatjahu's approval then we can merge this.
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.
LGTM 🚀
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.
Thanks @peter-rr for contribution! LGTM! 🚀
/rtm |
🎉 This PR is included in version 0.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
asyncapi convert
command.Related issue(s)
convert
command #41