cli icon indicating copy to clipboard operation
cli copied to clipboard

generator features

Open Souvikns opened this issue 3 years ago • 6 comments

CLI will be porting all the functionalities from the generator CLI, so as of now the supported options and commands by the generator CLI are

arguments

<asyncapi> <template> <asyncapi> - path to the asyncapi file <template> - template name

Options

  • -d, --disable-hook [hooks...] disable a specific hook type or hooks from a given hook type
  • --debug to enable specific errors in the console
  • -i, --install installs the template and its dependencies (defaults to false)
  • -n, --no-overwrite <glob> glob or path of the file(s) to skip when regenerating
  • -o, --output <outputDir> directory where to put the generated files (defaults to current directory)
  • -p, --param <name=value> additional param to pass to templates
  • --force-write force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)
  • --watch-template watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory.
  • --map-base-url <url:folder> maps all schema references from base url to local folder

Souvikns avatar Jun 02 '21 09:06 Souvikns

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Aug 02 '21 00:08 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Oct 02 '21 00:10 github-actions[bot]

Still valid. We need the generator commands in our cli.

magicmatatjahu avatar Oct 02 '21 07:10 magicmatatjahu

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:

github-actions[bot] avatar Jan 31 '22 00:01 github-actions[bot]

I'd suggest some improvements to the ag CLI, based on my recent experience using it with the Go generator.

  1. Depending on the case, it generally takes some time.
    • Since by default we don't have any "progress" or other feedback in the output, for anything that takes more than 10 seconds I guess anybody would start wondering if it's still going or it got stucked.
    • That's why currently I always use --debug although I don't get too many details either.
  2. Currently, the generation can take either ~30s or ~8s, depending on the case (described below).
    • Since generally the generation part would be mostly used, even if initially it may take more time, I'd say it could be acceptable to the User, while doing the initial setup once (that could include a local installation of the generator and anything else needed for later usage, such as any compilation or transpiling), but have this initial part relevant to prepare an efficient usage.

Sure enough, I'm currently referring to a GitHub repo instead of an NPM, but either way the UX can be improved. And maybe this can introduce some specifics. The usage is: ag /path/to/spec_aapi.yaml https://github.com/anandsunderraman/go-watermill-template/tree/rabbit-publisher -o gen_go_app

  • Running it first time it takes ~30s
  • Running it again it takes ~8s
  • Interesting enough, if I'm running it later (some minutes, I guess), it takes again ~30s

And I can assure you it's nothing wrong with my powerful workstation. :blush:

That's the moment when I'd like to have this generator preps done once and have a better response time. And when using --debug we always get that package is not available locally, and then you'd like to an option to install it locally (I mean globally at the user level, kinda like npm i -g, ofc)

Hope it helps! Thanks!

dxps avatar Mar 29 '22 14:03 dxps

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:

github-actions[bot] avatar Jul 28 '22 00:07 github-actions[bot]

:tada: This issue has been resolved in version 0.24.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Sep 27 '22 08:09 asyncapi-bot