asyncapi / html-template

HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.
63 stars 52 forks source link

[BUG] generator 2 with html-template does not work #619

Open laat opened 2 months ago

laat commented 2 months ago

Describe the bug.

npm i -D @asyncapi/generator @asyncapi/html-template
npx asyncapi-generator --force-write --output dist asyncapi.yaml @asyncapi/html-template

Gives the error

Something went wrong:
Error: This template is not compatible with the current version of the generator (2.0.0). This template is compatible with the following version range: >=1.15.0 <2.0.0.
    at isTemplateCompatible (/Users/n637831/git/astest/node_modules/@asyncapi/generator/lib/templateConfigValidator.js:57:11)
    at module.exports.validateTemplateConfig (/Users/n637831/git/astest/node_modules/@asyncapi/generator/lib/templateConfigValidator.js:30:3)
    at Generator.configureTemplateWorkflow (/Users/n637831/git/astest/node_modules/@asyncapi/generator/lib/generator.js:314:5)
    at async Generator.generate (/Users/n637831/git/astest/node_modules/@asyncapi/generator/lib/generator.js:202:5)
    at async Generator.generateFromFile (/Users/n637831/git/astest/node_modules/@asyncapi/generator/lib/generator.js:503:12)
    at async /Users/n637831/git/astest/node_modules/@asyncapi/generator/cli.js:157:9

Expected behavior

It should probably still work.

Screenshots

repro: https://github.com/laat/asyncapi-generator-repro

How to Reproduce

repro: https://github.com/laat/asyncapi-generator-repro

🥦 Browser

None

👀 Have you checked for similar open issues?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

derberg commented 2 months ago

PR is opened https://github.com/asyncapi/html-template/pull/615 but we need to wait for CLI.

Remember to never do npm i -D @asyncapi/generator @asyncapi/html-template

Best practice with dependencies is to always install fixed version and upgrade manually: https://www.asyncapi.com/docs/tools/generator/versioning

laat commented 2 months ago

Best practice with dependencies is to always install fixed version and upgrade manually: https://www.asyncapi.com/docs/tools/generator/versioning

I'm using package-lock.json. Caught this issue in a dependabot PR on my repo.

albertodiazdorado commented 2 months ago

It would be super nice if we could have the template work with the new version of the generator :pray: