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
755 stars 211 forks source link

Deprecation of AsyncAPI Generator CLI - removing `ag`, not the library #1008

Open derberg opened 1 year ago

derberg commented 1 year ago

tl;dr

So what I'm suggesting is basically:

What I do not know:

fmvilas commented 1 year ago

What about leaving the ag CLI but it always returns an error code and prints a message saying it's deprecated and you should use AsyncAPI CLI? Then in some time from now we just completely remove it.

derberg commented 1 year ago

@fmvilas the problem is that we will break many pipelines, this is why even releasing major will be harmful.

My experience tells me that many people, when use CLIs in CI/CD, do not care much about versioning and install latest. So for example if we remove cli and release it as 2.0, still under @asyncapi/generator then many CI/CD pipelines around the world will explode πŸ˜„ which is not nice πŸ˜„

Of course we can always say that it is not our fault that people use the tool wrong, but that ain't cool. If we know we might cause issues, we should try to avoid it, thus I think the best would be to simply release @asyncapi/generator-core and deprecate entire @asyncapi/generator.

smoya commented 1 year ago

What about importing the CLI in this generator, and call the generate logic through it? We could show a warning message saying this package is deprecated and keep the generator alive for a while. CLI dependency will be updated automatically (by the bot), meaning feature parity. We could keep it alive until a new major release of the CLI happens if that works.

derberg commented 1 year ago

@smoya keep in mind that CLI goal is to work just as a CLI and not be used as library.

and call the generate logic through it

this means exec the binary

smoya commented 1 year ago

@smoya keep in mind that CLI goal is to work just as a CLI and not be used as library.

But why adding such a constraint? Is there any strong reason of limiting that? Isn't possible to extract that logic into a proper service that can be called from code? I see only benefits, but for sure there is a reason for not allowing it that I'm missing.

smoya commented 1 year ago

In the very worst case, https://oclif.io/docs/running_programmatically

fmvilas commented 1 year ago

I think the best would be to simply release @asyncapi/generator-core and deprecate entire @asyncapi/generator.

Yeah, I vote for this too then.

smoya commented 1 year ago

I think the best would be to simply release @asyncapi/generator-core and deprecate entire @asyncapi/generator.

Yeah, I vote for this too then.

So just for my understanding, will then that library be used in CLI?

derberg commented 1 year ago

But why adding such a constraint? Is there any strong reason of limiting that? Isn't possible to extract that logic into a proper service that can be called from code? I see only benefits, but for sure there is a reason for not allowing it that I'm missing.

if there will be a strong use case that will be worth the effort, sure, why not. But definitely not worth doing with only assumption it makes sense.

So just for my understanding, will then that library be used in CLI?

yes, it will, it has to. We would just change name from @asyncapi/generator to @asyncapi/generator-core and the new version would not contain the CLI

smoya commented 1 year ago

yes, it will, it has to. We would just change name from @asyncapi/generator to @asyncapi/generator-core and the new version would not contain the CLI

Makes totally sense then. I like the approach πŸ™Œ

github-actions[bot] commented 9 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:

anandsunderraman commented 8 months ago

@derberg What is the process to migrate a generator template from ag to cli ?

derberg commented 8 months ago

@anandsunderraman non. Should work out of the box. You just need to update commands examples in readme, to follow asyncapi generate fromTemplate

lmgyuan commented 5 months ago

Does this issue still need help? Based on my understanding of it, it looks like there might still be work needed to update the readme and documentation to reflect the changes and guide users on how to transition from ag to the AsyncAPI CLI. Is my understanding correct? If so, I am happy to help! : )

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: