Skip to content
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

docs(generator): update latest generator documentation #3602

Merged

Conversation

asyncapi-bot
Copy link
Contributor

@asyncapi-bot asyncapi-bot commented Jan 23, 2025

Updated generator documentation is available and this PR introduces update to generator folder on the website

Summary by CodeRabbit

  • Documentation
    • Added migration guide for transitioning from ag CLI to AsyncAPI CLI
    • Added migration guide for moving from Nunjucks to React render engine
    • Updated documentation with deprecation notice for Nunjucks render engine, recommending migration to React render engine

Copy link
Contributor

coderabbitai bot commented Jan 23, 2025

Warning

Rate limit exceeded

@derberg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b21298f and 19a2185.

📒 Files selected for processing (1)
  • markdown/docs/tools/generator/migration-cli.md (1 hunks)

Walkthrough

This pull request introduces comprehensive documentation updates for the AsyncAPI Generator, focusing on the deprecation of the Nunjucks render engine and the migration to the React render engine. The changes include adding deprecation notices to existing documentation, creating a new migration guide for transitioning from Nunjucks to React templates, and providing a detailed CLI migration guide to help users smoothly adopt the new AsyncAPI CLI and render engine.

Changes

File Change Summary
markdown/docs/tools/generator/file-templates.md Added deprecation note for Nunjucks render engine
markdown/docs/tools/generator/migration-cli.md New document: Comprehensive guide for migrating from ag CLI to AsyncAPI CLI
markdown/docs/tools/generator/migration-nunjucks-react.md New document: Detailed migration guide from Nunjucks to React templates
markdown/docs/tools/generator/nunjucks-render-engine.md Added deprecation notice recommending switch to React render engine

Possibly related PRs

Suggested reviewers

  • quetzalliwrites
  • BhaswatiRoy
  • J0SAL
  • TRohit20
  • VaishnaviNandakumar
  • asyncapi-bot-eve

Poem

🐰 Hop, hop, farewell Nunjucks dear,
React's the path, the future's here!
Templates dance with new delight,
Migration's journey, smooth and bright.
Generator's magic, reimagined and clear! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 23, 2025

Deploy Preview for asyncapi-website ready!

Name Link
🔨 Latest commit 19a2185
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/6792006818d6c200085874d4
😎 Deploy Preview https://deploy-preview-3602--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a817f85) to head (19a2185).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3602   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          732       732           
=========================================
  Hits           732       732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
markdown/docs/tools/generator/migration-cli.md (1)

50-52: Add language specifiers to code blocks.

The code blocks should specify their language for proper syntax highlighting.

Apply this diff:

-```
+```bash
 ag ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName

- +bash
asyncapi generate fromTemplate ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName

Also applies to: 55-57

🧰 Tools
🪛 Markdownlint (0.37.0)

50-50: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

markdown/docs/tools/generator/migration-nunjucks-react.md (1)

36-36: Fix grammatical issues.

Minor grammatical improvements needed:

Apply this diff:

-Below you can see some examples of filenames:
+Below, you can see some examples of filenames:

-introduced the React render engine from article
+introduced the React render engine from the article

Also applies to: 144-144

🧰 Tools
🪛 LanguageTool

[uncategorized] ~36-~36: Possible missing comma found.
Context: ...omponent used inside the template file. Below you can see some examples of filenames:...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a817f85 and 5e3813a.

📒 Files selected for processing (4)
  • markdown/docs/tools/generator/file-templates.md (1 hunks)
  • markdown/docs/tools/generator/migration-cli.md (1 hunks)
  • markdown/docs/tools/generator/migration-nunjucks-react.md (1 hunks)
  • markdown/docs/tools/generator/nunjucks-render-engine.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
markdown/docs/tools/generator/migration-cli.md

50-50: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


55-55: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 LanguageTool
markdown/docs/tools/generator/migration-nunjucks-react.md

[uncategorized] ~36-~36: Possible missing comma found.
Context: ...omponent used inside the template file. Below you can see some examples of filenames:...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~144-~144: Possible missing article found.
Context: ...introduced the React render engine from article [React as a Generator Engine](https://w...

(AI_HYDRA_LEO_MISSING_THE)

⏰ Context from checks skipped due to timeout of 180000ms (2)
  • GitHub Check: Automerge PR autoapproved by a bot
  • GitHub Check: Lighthouse CI
🔇 Additional comments (4)
markdown/docs/tools/generator/migration-cli.md (1)

1-70: LGTM! Well-structured migration guide.

The migration guide is comprehensive and well-organized, covering:

  • Clear mapping of old to new CLI options
  • Step-by-step migration instructions
  • Verification steps
  • Additional resources
🧰 Tools
🪛 Markdownlint (0.37.0)

50-50: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


55-55: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

markdown/docs/tools/generator/nunjucks-render-engine.md (1)

6-6: LGTM! Clear deprecation notice.

The deprecation notice is well-placed at the beginning of the document and provides a clear directive to use the React renderer engine instead, with a link to more details.

markdown/docs/tools/generator/migration-nunjucks-react.md (1)

1-144: LGTM! Excellent migration guide.

The migration guide is thorough and well-structured, covering:

  • Step-by-step migration process
  • Clear examples comparing Nunjucks and React implementations
  • Testing recommendations
  • Additional resources
🧰 Tools
🪛 LanguageTool

[uncategorized] ~36-~36: Possible missing comma found.
Context: ...omponent used inside the template file. Below you can see some examples of filenames:...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~144-~144: Possible missing article found.
Context: ...introduced the React render engine from article [React as a Generator Engine](https://w...

(AI_HYDRA_LEO_MISSING_THE)

markdown/docs/tools/generator/file-templates.md (1)

10-10: LGTM! Clear deprecation notice.

The deprecation notice is well-placed and consistent with the notice in other files, providing a clear directive to use the React renderer engine instead.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
markdown/docs/tools/generator/migration-cli.md (2)

12-14: Add example for complex disable-hook option.

Consider adding a concrete example for the --disable-hook option to demonstrate its usage, as it's one of the more complex options with multiple parameters.

 - **-d, --disable-hook [hooks...]**
   - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --disable-hook <hookType>=<hookName>`
+  - **Example:** `asyncapi generate fromTemplate api.yaml @asyncapi/html-template --disable-hook generate=createDirectories`

65-70: Consider adding a troubleshooting section.

The resources section is helpful, but consider adding a "Common Issues" or "Troubleshooting" section to address frequently encountered migration challenges.

 ## Additional Resources
 
 **CLI Documentation**: [AsyncAPI CLI Documentation](https://www.asyncapi.com/docs/tools/cli)
 **Installation**: [AsyncAPI CLI Installation](https://www.asyncapi.com/docs/tools/cli/installation)
 **Usage**: [AsyncAPI CLI Usage](https://www.asyncapi.com/docs/tools/cli/usage)
 **Support**: For any issues with CLI, create an issue in [CLI repository](https://github.com/asyncapi/cli).
+
+## Common Issues
+
+- **Error: Template not found**: Ensure you're using the correct template name and it's installed properly
+- **Migration validation**: Use `--debug` flag to verify the command translation
+- **Template compatibility**: Check template compatibility with the new CLI version
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e3813a and b21298f.

📒 Files selected for processing (1)
  • markdown/docs/tools/generator/migration-cli.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
markdown/docs/tools/generator/migration-cli.md

50-50: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


55-55: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 180000ms (1)
  • GitHub Check: Lighthouse CI
🔇 Additional comments (1)
markdown/docs/tools/generator/migration-cli.md (1)

1-7: LGTM! Clear and concise introduction.

The frontmatter is properly formatted and the introduction clearly states the purpose of the guide.

Comment on lines +49 to +57
**Using `ag`**:
```
ag ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName
```

**Using AsyncAPI CLI**:
```
asyncapi generate fromTemplate ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add language specifiers to code blocks.

Add language specifiers to the fenced code blocks for proper syntax highlighting:

-```
+```bash
 ag ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName

- +bash
asyncapi generate fromTemplate ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName

🧰 Tools
🪛 Markdownlint (0.37.0)

50-50: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


55-55: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

@asyncapi-bot
Copy link
Contributor Author

asyncapi-bot commented Jan 23, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 34
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3602--asyncapi-website.netlify.app/

@asyncapi-bot
Copy link
Contributor Author

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 45
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3602--asyncapi-website.netlify.app/

@derberg derberg merged commit 45f6f85 into master Jan 23, 2025
19 checks passed
@derberg derberg deleted the update-generator-docs-fd5dfd7687c0e4899a548718bf420226a5cd60f9 branch January 23, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants