asyncapi / cli

CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!
https://www.asyncapi.com/tools/cli
Apache License 2.0
188 stars 164 forks source link

[BUG] Very out of date package JSON, breaking documentation example. #1562

Open dk-coligo opened 4 weeks ago

dk-coligo commented 4 weeks ago

Describe the bug.

The documentation example https://www.asyncapi.com/tools/generator is to run using:

docker run --rm -it --user=root -v ${PWD}/example:/app/example -v ${PWD}/output:/app/output \
asyncapi/cli generate fromTemplate https://bit.ly/asyncapi @asyncapi/html-template -o example

However, the versions in the asyncapi/cli:2.8.0 (and many others) are out of date: package.json.

{
  "name": "@asyncapi/cli",
  "description": "All in one CLI for all AsyncAPI tools",
  "version": "2.8.0",
  "author": "@asyncapi",
  "bin": {
    "asyncapi": "./bin/run_bin"
  },
  "bugs": "https://github.com/asyncapi/cli/issues",
  "dependencies": {
    "@asyncapi/avro-schema-parser": "^3.0.23",
    "@asyncapi/bundler": "^0.6.3",
    "@asyncapi/converter": "^1.6.2",
    "@asyncapi/diff": "^0.4.1",
    "@asyncapi/generator": "^1.17.25",

resulting in the following errors:

◑  Generation in progress. Keep calm and wait a bit..Template @asyncapi/html-template successfully installed in /usr/local/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template.
Version of used template is 3.0.0.
◇  Generation failed
Generator Error: This template is not compatible with the current version of the generator (1.17.25). This template is compatible with the following version range: >=2.0.0 <3.0.0.

Expected behavior

Working example from homepage

Screenshots

image

How to Reproduce

Run the example from the homepage: https://www.asyncapi.com/tools/generator

🥦 Browser

None

👀 Have you checked for similar open issues?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

github-actions[bot] commented 4 weeks ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

dk-coligo commented 4 weeks ago

For example, current generator version is: 2.4.1 https://github.com/asyncapi/generator/releases

Container for the CLI:2.8.0 is running the following versions:

@asyncapi/cli/2.8.0 linux-x64 node-v20.18.0
  ├@asyncapi/avro-schema-parser/3.0.24
  ├@asyncapi/bundler/0.6.4
  ├@asyncapi/converter/1.6.2
  ├@asyncapi/diff/0.4.1
  ├@asyncapi/generator/1.17.25
  ├@asyncapi/modelina-cli/4.0.0-next.62
  ├@asyncapi/openapi-schema-parser/3.0.24
  ├@asyncapi/optimizer/1.0.4
  ├@asyncapi/parser/3.3.0
  ├@asyncapi/protobuf-schema-parser/3.2.14
  ├@asyncapi/raml-dt-schema-parser/4.0.24
  └@asyncapi/studio/0.20.2

Repository: https://github.com/asyncapi/cli
bernarth commented 3 weeks ago

The error Generator Error: This template is not compatible with the current version of the generator (1.17.25). This template is compatible with the following version range: >=2.0.0 <3.0.0. is happening to me as well. I think the latest version of the generator should be used instead ( current version here ) which is 2.5.0 today

abiola-deimos commented 2 weeks ago

Does anyone know what the workaround is?

bernarth commented 2 weeks ago

I am using html-template so, I am using an specific version of it. -> 2.3.14 With the example above it could be something like: docker run --rm -it --user=root -v ${PWD}/example:/app/example -v ${PWD}/output:/app/output \ asyncapi/cli generate fromTemplate https://bit.ly/asyncapi @asyncapi/html-template@2.3.14 -o example

You can use a compatible version (if you are using html-template here )

yenidunya commented 4 days ago

The error Generator Error: This template is not compatible with the current version of the generator (1.17.25). This template is compatible with the following version range: >=2.0.0 <3.0.0. is happening to me as well. I think the latest version of the generator should be used instead ( current version here ) which is 2.5.0 today

tried changing it in package.json and then installing cli. installed version of the generator seems OK but then I received following error while using generate:

    return oclifHandler(err.message);
           ^

TypeError: oclifHandler is not a function
bernarth commented 32 minutes ago

I tried the same. But, when installing the CLI it comes with an older version of the installed packages which causes conflicts.