-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Use @asyncapi/cli under the hood #485
Comments
what about pulling |
I completely like this idea 👍 |
This 💯 |
For reference, this topic has been already raised at some point but nothing moved forward: |
Two for the price of one baby 👍 |
I'll take it |
@smoya yeah that was long time before. as current CLI codeowner I'm completely fine if you sunset but we need also @BOLT04 voice as he is owner here too. of course, current owners of server-api would have an option to become owners in CLI. We anyway need to upgrade the contribution structure as already suggested asyncapi/cli#781 |
I pinged them additionally via Slack. |
Yeah, I like this idea. |
We can start implementing the most critical API endpoints, studio for instance only uses |
This would be perfect but it's currently not possible because Studio is a client-side app and Generator doesn't work on the browser. If we ever make Studio a server-side app then it should be easy to do. |
/progress 40 Migrated the CLI architecture will change to accommodate new changes and the migration of remaining endpoints. I'll be using Hexagonal architecture. Before (CLI)
After (CLI)
|
fully agreed @derberg and @smoya 🙂. This seems to be the best approach, mainly to keep CLI enhancements and new features in sync with this API that has fallen way too much behind.
@Amzani I don't think this API is used in other tools in the ecosystem besides studio like you said. We would need to bring the API deployment parts to the CLI repo and focus on the used endpoints yes. |
As we don't have 100% visibility of who is using this API, and don't want to break current clients, I suggest using a new domain for the new API that will be hosted by CLI during the migration phase. Can someone help with the new domain and digital ocean app? |
Domain stuff goes on either @fmvilas or @derberg afaik. |
Ping me on Slack whenever you know which domain you want and where to point. Happy to assist with that. |
/progress 50 I've added some basic APIs tests in asyncapi/cli#1200 |
sounds good, just remember that once we will deploy server api from context of |
/progress 60 Looking at how to reorganize different commands: asyncapi/cli#781, and discovered that we are using an old version of @oclif/core that we need to migrate to the latest version |
Reason/Context
Server-API is not so different to what https://github.com/asyncapi/cli is. The big difference remains on the Ports they expose. Beyond that, the logic they perform is precisely the same:
In the current Server-API implementation, all the actions the user can perform (commands in CLI) are coded from scratch, using exactly the same dependencies as the CLI has (Parser-JS, Generator, etc). As mentioned above, they look pretty much the same as the commands in CLI.
One of the main issues of having all of this duplication of work is that Server-API falls behind what CLI can do pretty often. Then, people trying to, for example, generate code through the Studio, ends up with a different output than when they use the CLI.
For example, there have been efforts in CLI to enable all commands to work for v3 of the spec. However, Server-API still falls way behind on giving support for v3. See #294 and asyncapi/studio#926.
By using https://github.com/asyncapi/cli in Server-API, we would break that gap; every new update on the CLI (on those commands the Server-API relies on) will be automatically adopted by just updating the dependency.
Description
The point is that neither the CLI and other dependencies (such the Generator) are completely ready to make this possible. For example, CLI doesn't export the functions inside the commands.
We would need to work on the CLI repository to extract all the logic inside each command to exportable functions (command handlers) so we can reuse them here.
I strongly believe on this change as a must, otherwise Server-API will keep falling behind due to the low bandwidth maintainers are running lately. I also believe it is a good win to invest on this rather to instead find more maintainers to maintain the beast.
Relates somehow to https://github.com/orgs/asyncapi/discussions/212
cc @magicmatatjahu @BOLT04 and rest of CLI Owners folks @Souvikns @derberg to know wdyt.
The text was updated successfully, but these errors were encountered: