Skip to content

Conversation

@batchu5
Copy link

@batchu5 batchu5 commented Nov 23, 2025

Description

Adds automated API documentation generation for components using jsdoc-to-markdown and a custom Handlebars template.
This improves consistency and readability of the generated API.md file.

Changes

  • Added jsdoc-to-markdown v9.1.13 as a development dependency
  • Updated package.json scripts:
    • generate:assets now runs both prepublishOnly and docs
    • docs uses jsdoc2md with a custom api.hbs template to generate API.md
  • Added api.hbs to define the structure and layout of the final API documentation
  • Enabled automatic conversion of JSDoc comments from all files under src/**/*.js into a clean Markdown API file

Related issue(s)

Resolves #1656

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive API guide and a template to render function API docs for WebSocket code generation; clarified public-facing types, props, return values, rendering variations, and minor wording tweaks.
  • Chores
    • Added an automated docs generation script, a dev dependency for docs generation, and updated the asset-generation workflow to produce and include the generated API.md.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2025

⚠️ No Changeset found

Latest commit: 34f53ff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@asyncapi-bot
Copy link
Contributor

What reviewer looks at during PR review

The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.

  1. PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means spoken or written as if giving a command or instruction, like "add new helper for listing operations")

    Note - In Generator, prepend feat: or fix: in PR title only when PATCH/MINOR release must be triggered.

  2. PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.

    Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes Resolves #<issue-number> or Fixes #<issue-number> this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow.

  3. Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.

  4. Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.

  5. DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.

  6. Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.

  7. Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.

  8. Template Design Principles Alignment: While reviewing template-related changes in the packages/ directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project.

  9. Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.

  10. Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.

@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Walkthrough

Adds generated API documentation support (API.md + Handlebars template and docs script), includes jsdoc-to-markdown devDependency, and updates JSDoc typedefs/aliases across many components; changes are documentation and JSDoc/type-annotation focused with no runtime logic changes.

Changes

Cohort / File(s) Summary
Docs & generation
packages/components/API.md, packages/components/api.hbs, packages/components/package.json
Adds API.md and api.hbs template; adds docs script (jsdoc2md --template api.hbs "./lib/**/*.js" > API.md), runs it from generate:assets, adds jsdoc-to-markdown devDependency, and includes API.md in files.
WebSocket handler typedef edits
packages/components/src/components/CloseConnection.js, packages/components/src/components/HandleMessage.js, packages/components/src/components/RegisterErrorHandler.js, packages/components/src/components/RegisterMessageHandler.js
Replace optional methodDocs?: string annotations with explicit `methodDocs: string
MethodGenerator JSDoc tightening
packages/components/src/components/MethodGenerator.js
Adjusts JSDoc typedefs to use explicit `...: string
Query params typedef adjustment
packages/components/src/components/QueryParamsVariables.js
Changes QueryParamCodeBlock properties from optional keys to explicit unions (`indent: number
Send operations typedefs
packages/components/src/components/SendOperations.js
Adds SendOperationMethods and SendOperationGenerator typedefs and updates websocketSendOperationConfig to reference the new alias.
Models typedef update
packages/components/src/components/Models.js
Adds ModelinaGenerator typedef and updates generatorConfig to use it instead of an inline constructor type.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • packages/components/api.hbs — ensure the template fields (params, returns, functions) match actual jsdoc2md output shape.
    • JSDoc syntax changes (optional -> type | undefined) — verify jsdoc-to-markdown renders these as intended and that the typedefs accurately reflect runtime optionality.
    • MethodGenerator and Models typedef edits — confirm the new typedefs align with actual runtime shapes and external generators.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add api generation for components' clearly summarizes the main change: adding API documentation generation for components.
Linked Issues check ✅ Passed All coding requirements from issue #1656 are met: API.md generation is integrated into npm run generate:assets, jsdoc-to-markdown is added, api.hbs template is created, and JSDoc types are updated for documentation consistency.
Out of Scope Changes check ✅ Passed All changes are directly related to API documentation generation. Type annotation updates across components files (CloseConnection, HandleMessage, MethodGenerator, etc.) are necessary for proper jsdoc-to-markdown parsing and documentation clarity, not out-of-scope modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5b9b38 and 34f53ff.

📒 Files selected for processing (6)
  • packages/components/src/components/CloseConnection.js (2 hunks)
  • packages/components/src/components/HandleMessage.js (2 hunks)
  • packages/components/src/components/MethodGenerator.js (2 hunks)
  • packages/components/src/components/QueryParamsVariables.js (1 hunks)
  • packages/components/src/components/RegisterErrorHandler.js (2 hunks)
  • packages/components/src/components/RegisterMessageHandler.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/components/src/components/QueryParamsVariables.js
  • packages/components/src/components/RegisterErrorHandler.js
  • packages/components/src/components/CloseConnection.js
  • packages/components/src/components/HandleMessage.js
  • packages/components/src/components/MethodGenerator.js
🔇 Additional comments (2)
packages/components/src/components/RegisterMessageHandler.js (2)

10-10: Type annotation correctly addresses jsdoc-to-markdown parsing issue.

The change from methodDocs?: string to methodDocs: string | undefined resolves the jsdoc-to-markdown parser error with optional property syntax while maintaining semantic correctness. The explicit union type is parseable and accurately reflects that methodDocs may be absent (as seen in the python entry).


34-34: LGTM: Documentation improvement.

The hyphenation of "pre- and post-execution logic" improves readability and grammatical correctness for compound modifiers.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 11

🧹 Nitpick comments (1)
packages/components/src/components/Models.js (1)

22-26: Reconsider the @Class documentation placement.

This @class JSDoc block documents ModelinaGenerator, but this class is not defined in this file—it's an external type imported from @asyncapi/modelina (e.g., PythonGenerator, JavaGenerator, etc. on lines 3-9).

Documenting external classes in your own codebase can be misleading to maintainers and documentation generators. Consider either:

  1. Removing this block entirely and relying on the library's own documentation
  2. Using @typedef to create a type alias that references the external generator classes

If you want to keep type documentation, use a typedef instead:

-/**
- * @class ModelinaGenerator
- * @classdesc Represents a Modelina generator class.
- * @param {object} [options] - Optional generator options.
- */
+/**
+ * @typedef {import('@asyncapi/modelina').PythonGenerator | import('@asyncapi/modelina').JavaGenerator | import('@asyncapi/modelina').TypeScriptGenerator | import('@asyncapi/modelina').CSharpGenerator | import('@asyncapi/modelina').RustGenerator | import('@asyncapi/modelina').JavaScriptGenerator} ModelinaGenerator
+ * Represents any Modelina generator class instance.
+ */
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc9f60 and 3ff3f65.

📒 Files selected for processing (11)
  • packages/components/API.md (1 hunks)
  • packages/components/api.hbs (1 hunks)
  • packages/components/package.json (2 hunks)
  • packages/components/src/components/CloseConnection.js (1 hunks)
  • packages/components/src/components/HandleMessage.js (1 hunks)
  • packages/components/src/components/MethodGenerator.js (2 hunks)
  • packages/components/src/components/Models.js (1 hunks)
  • packages/components/src/components/QueryParamsVariables.js (1 hunks)
  • packages/components/src/components/RegisterErrorHandler.js (1 hunks)
  • packages/components/src/components/RegisterMessageHandler.js (1 hunks)
  • packages/components/src/components/SendOperations.js (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-05-12T14:23:48.919Z
Learnt from: derberg
Repo: asyncapi/generator PR: 1551
File: apps/generator/docs/generator-template.md:45-73
Timestamp: 2025-05-12T14:23:48.919Z
Learning: AsyncAPI 3.0.0 specification introduces significant structural changes from 2.x:
1. Operations become top-level elements with action property (send/receive) and references to channels
2. Channels use 'address' for the topic path instead of having nested publish/subscribe operations
3. Messages are defined under a 'messages' container in channels
4. The specification decouples operations, channels and messages to improve reusability
5. Servers can use a 'host' property

Applied to files:

  • packages/components/src/components/SendOperations.js
  • packages/components/API.md
📚 Learning: 2025-05-12T14:23:48.919Z
Learnt from: derberg
Repo: asyncapi/generator PR: 1551
File: apps/generator/docs/generator-template.md:45-73
Timestamp: 2025-05-12T14:23:48.919Z
Learning: AsyncAPI 3.0.0 specification introduces significant structural changes from 2.x:
1. Operations become top-level elements with references to channels
2. Channels use 'address' for the topic path instead of having nested publish/subscribe
3. Messages are defined under a 'messages' container in channels
4. Servers can use a 'host' property

Applied to files:

  • packages/components/API.md
📚 Learning: 2025-05-12T14:57:35.024Z
Learnt from: Adi-204
Repo: asyncapi/generator PR: 1557
File: packages/templates/clients/websocket/javascript/components/SendOperation.js:21-21
Timestamp: 2025-05-12T14:57:35.024Z
Learning: In the AsyncAPI generator templates, particularly in the JavaScript WebSocket client, single quotes are used for string literals inside template-generated code (which is itself inside backticks) to preserve template placeholders like ${variable} as literal text in the generated code output.

Applied to files:

  • packages/components/API.md
🪛 LanguageTool
packages/components/API.md

[grammar] ~2-~2: Use a hyphen to join words.
Context: ...ection method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~54-~54: Use a hyphen to join words.
Context: ...andler method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~150-~150: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~163-~163: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
packages/components/API.md

4-4: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


17-17: Multiple headings with the same content

(MD024, no-duplicate-heading)


18-18: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


25-25: Multiple headings with the same content

(MD024, no-duplicate-heading)


26-26: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


34-34: Multiple headings with the same content

(MD024, no-duplicate-heading)


35-35: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


45-45: Multiple headings with the same content

(MD024, no-duplicate-heading)


46-46: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


55-55: Multiple headings with the same content

(MD024, no-duplicate-heading)


56-56: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


72-72: Multiple headings with the same content

(MD024, no-duplicate-heading)


73-73: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


86-86: Table column count
Expected: 3; Actual: 4; Too many cells, extra data will be missing

(MD056, table-column-count)


90-90: Multiple headings with the same content

(MD024, no-duplicate-heading)


91-91: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


102-102: Multiple headings with the same content

(MD024, no-duplicate-heading)


103-103: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


111-111: Multiple headings with the same content

(MD024, no-duplicate-heading)


112-112: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


118-118: Multiple headings with the same content

(MD024, no-duplicate-heading)


119-119: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


125-125: Multiple headings with the same content

(MD024, no-duplicate-heading)


126-126: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


134-134: Multiple headings with the same content

(MD024, no-duplicate-heading)


135-135: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


142-142: Multiple headings with the same content

(MD024, no-duplicate-heading)


143-143: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


151-151: Multiple headings with the same content

(MD024, no-duplicate-heading)


152-152: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


164-164: Multiple headings with the same content

(MD024, no-duplicate-heading)


165-165: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


177-177: Multiple headings with the same content

(MD024, no-duplicate-heading)


178-178: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

🔇 Additional comments (4)
packages/components/src/components/Models.js (1)

30-30: LGTM: Improved type reference.

Changing from an inline constructor signature to the named ModelinaGenerator type improves readability and maintainability.

packages/components/src/components/SendOperations.js (1)

9-24: LGTM: Well-structured type definitions.

The new SendOperationMethods and SendOperationGenerator type definitions improve code documentation and type clarity. The refactoring from an inline type to named types makes the API more maintainable.

packages/components/package.json (2)

13-13: No issues found — jsdoc2md command and paths are correctly configured.

The verification confirms:

  • Template file api.hbs exists at packages/components/api.hbs
  • Glob pattern ./src/**/*.js correctly matches all 16 source files ✓
  • Relative path resolution works as expected from the npm script execution context ✓

43-43: No issues found—version 9.1.3 is current and compatible.

jsdoc-to-markdown v9.1.3 requires Node.js >= 12.17.0, and the version was released on October 3, 2025, making it current. The specified version is appropriate for the project.

| Name | Type | Description |
|------|------|-------------|
{{#each params}}
| {{name}} | {{type.names.[0]}} | {{description}} |
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use Handlebars-standard array index syntax.

The bracket notation .[0] is non-standard for Handlebars. Use .0 instead to access the first array element.

Apply this diff:

-| {{name}} | {{type.names.[0]}} | {{description}} |
+| {{name}} | {{type.names.0}} | {{description}} |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| {{name}} | {{type.names.[0]}} | {{description}} |
| {{name}} | {{type.names.0}} | {{description}} |
🤖 Prompt for AI Agents
In packages/components/api.hbs around line 9, the template uses non-standard
Handlebars bracket notation `.[0]` to access the first array element; replace
`{{type.names.[0]}}` with the Handlebars-standard `{{type.names.0}}` so the
template uses proper array index syntax and renders correctly.

Comment on lines 1 to 183
## Functions
### **CloseConnection** - Renders a WebSocket close connection method with optional pre and post execution logic.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | Programming language used for method formatting. |
| props.framework | string | Framework used, if any (e.g., &#x27;quarkus&#x27; for Java). |
| props.methodName | string | Name of the method to generate. |
| props.methodParams | Array.&lt;string&gt; | List of parameters for the method. |
| props.preExecutionCode | string | Code to insert before the main function logic. |
| props.postExecutionCode | string | Code to insert after the main function logic. |
| props.indent | number | Indentation level for the method block. |

@returns JSX.Element
### **Connect** - Component that renders WebSocket connection method for the specified programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component properties. |
| props.language | SupportedLanguage | The programming language for which to generate connection code. |
| props.title | string | The title of the WebSocket server. |

### **resolveDependencies** - Helper function to resolve dependencies based on language, framework, and role.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| language | Language | The programming language. |
| framework | string | The framework (e.g., &#x27;quarkus&#x27; for Java). |
| role | string | The role (e.g., &#x27;client&#x27;, &#x27;connector&#x27; for Java). |

@returns Array.&lt;string&gt;
### **DependencyProvider** - Renders the top-of-file dependency statements for the selected programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | The programming language for which to render dependency statements. |
| props.framework | string | The framework (e.g., &#x27;quarkus&#x27; for Java). |
| props.role | string | The role (e.g., &#x27;client&#x27;, &#x27;connector&#x27; for Java). |
| props.additionalDependencies | Array.&lt;string&gt; | Optional additional dependencies to include. |

@returns JSX.Element
### **FileHeaderInfo** - Renders a file header with metadata information such as title, version, protocol, host, and path.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.info | object | Info object from the AsyncAPI document. |
| props.server | object | Server object from the AsyncAPI document. |
| props.language | Language | Programming language used for comment formatting. |

@returns JSX.Element
### **HandleMessage** - Renders a WebSocket message handler method with optional pre and post execution logic.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | Programming language used for method formatting. |
| props.methodName | string | Name of the method to generate. |
| props.methodParams | Array.&lt;string&gt; | List of parameters for the method. |
| props.preExecutionCode | string | Code to insert before the main function logic. |
| props.postExecutionCode | string | Code to insert after the main function logic. |
| props.customMethodConfig | Object | Optional overrides for default method configuration. |

@returns JSX.Element
### **resolveDocsAndLogic** - Resolve docs and logic for the given language + framework config.

### **buildIndentedLogic** - Build indented method body.

### **MethodGenerator** - Generic Method rendering component.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | Programming language used for method formatting. |
| props.methodName | string | Name of the method. |
| props.methodParams | Array.&lt;string&gt; | Method parameters. |
| props.methodDocs | string | Optional documentation string. |
| props.methodLogic | string | Core method logic. |
| props.preExecutionCode | string | Code before main logic. |
| props.postExecutionCode | string | Code after main logic. |
| props.indent | number | Indentation for the method block. |
| props.newLines | number | Number of new lines after method. |
| props.customMethodConfig | Object | Optional custom syntax configuration for the current language. |
| props.methodConfig | Record.&lt;Language, ({methodDocs: string, methodLogic: string}|Record.&lt;string, {methodDocs: string, methodLogic: string}&gt;)&gt; | Language-level or framework-level configuration. |
| props.framework | string | Framework name for nested configurations (e.g., &#x27;quarkus&#x27; for Java). |

### **Models** - Generates and returns an array of model files based on the AsyncAPI document.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| params | Object | The parameters for the function. |
| params.asyncapi | AsyncAPIDocumentInterface | Parsed AsyncAPI document object. |
| params.language | Language | Target programming language for the generated models. |
| params.format | Format | Naming format for generated files. |
| params.presets | object | Custom presets for the generator instance. |
| params.constraints | object | Custom constraints for the generator instance. |

@returns Array.&lt;File&gt;
### **OnClose** - Component that renders WebSocket onClose event handler for the specified programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component properties. |
| props.language | SupportedLanguage | The programming language for which to generate onClose handler code. |
| props.framework | string | Optional framework variant (e.g., &#x27;quarkus&#x27; for java). |
| props.title | string | The title of the WebSocket server. |

### **OnError** - Component that renders WebSocket onError event handler for the specified programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component properties. |
| props.language | SupportedLanguage | The programming language for which to generate onError handler code. |

### **OnMessage** - Component that renders WebSocket onMessage event handler for the specified programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component properties. |
| props.language | SupportedLanguage | The programming language for which to generate onMessage handler code. |

### **OnOpen** - Component that renders WebSocket onOpen event handler for the specified programming language.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component properties. |
| props.language | SupportedLanguage | The programming language for which to generate onOpen handler code. |
| props.framework | string | Optional framework variant (e.g., &#x27;quarkus&#x27; for java). |
| props.title | string | The title of the WebSocket server. |

### **resolveQueryParamLogic** - Resolve the appropriate query parameter configuration function based on language and framework.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| language | SupportedLanguage | The target programming language. |
| framework | string | Optional framework (e.g., &#x27;quarkus&#x27; for Java). |

@returns function
### **QueryParamsVariables** - Component for rendering query parameter variables code.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | SupportedLanguage | The target programming language. |
| props.framework | string | Optional framework for the language. |
| props.queryParams | Array.&lt;Array.&lt;string&gt;&gt; | Array of query parameters, each represented as [paramName, paramType?]. |

### **RegisterErrorHandler** - Renders a WebSocket error handler registration method with optional pre and post execution logic.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | Programming language used for method formatting. |
| props.methodName | string | Name of the method to generate. |
| props.methodParams | Array.&lt;string&gt; | List of parameters for the method. |
| props.preExecutionCode | string | Code to insert before the main function logic. |
| props.postExecutionCode | string | Code to insert after the main function logic. |
| props.customMethodConfig | Object | Optional overrides for default method configuration. |

@returns JSX.Element
### **RegisterMessageHandler** - Renders a WebSocket message handler registration method with optional pre and post execution logic.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | Language | Programming language used for method formatting. |
| props.methodName | string | Name of the method to generate. |
| props.methodParams | Array.&lt;string&gt; | List of parameters for the method. |
| props.preExecutionCode | string | Code to insert before the main function logic. |
| props.postExecutionCode | string | Code to insert after the main function logic. |

@returns JSX.Element
### **SendOperations** - Component for rendering WebSocket send operation methods.Generates both static and instance methods for sending messages through WebSocket connections.
### Parameters
| Name | Type | Description |
|------|------|-------------|
| props | Object | Component props. |
| props.language | SupportedLanguage | The target programming language. |
| props.sendOperations | Array.&lt;Object&gt; | Array of send operations from AsyncAPI document. |
| props.clientName | string | The name of the client class. |

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

Generated file - issues should be fixed in source.

This file is auto-generated by jsdoc2md from source JSDoc comments and the api.hbs template. Static analysis has flagged several issues:

  1. Line 86 table column count mismatch - The table has 4 columns but the header defines 3. This indicates a problem in the source JSDoc for the MethodGenerator component's methodConfig parameter.
  2. Grammar issues - Multiple instances of "pre and post execution" should be "pre- and post-execution" in the source JSDoc comments.
  3. Markdown formatting - Tables missing blank lines and duplicate headings are caused by the template structure.

Do not manually edit this file. Instead:

  • Fix the source JSDoc comments in the component files under src/
  • Update the api.hbs template to address formatting issues

Run this script to find the source of the table issue:


🏁 Script executed:

#!/bin/bash
# Find the MethodGenerator component and check its JSDoc
echo "Looking for MethodGenerator JSDoc..."
rg -A 20 "MethodGenerator" packages/components/src/ --type js

# Check for "methodConfig" parameter documentation
echo -e "\n\nLooking for methodConfig parameter..."
rg -B 5 -A 5 "methodConfig" packages/components/src/ --type js

Length of output: 20265


</shell_scripts_instructions>


🏁 Script executed:

#!/bin/bash
# Search for "pre and post execution" phrase in JSDoc comments
echo "Searching for 'pre and post execution' phrase..."
rg "pre and post execution" packages/components/src/ --type js

# Also check for any grammar issues in JSDoc descriptions
echo -e "\n\nSearching for descriptions with 'execution' in component files..."
rg -B 2 "execution" packages/components/src/components/ --type js | head -50

Length of output: 1819


Looking at the API.md snippet provided in the review comment, I can find the MethodGenerator function documentation. Counting the parameters table columns for MethodGenerator:

The table header shows: | Name | Type | Description | (3 columns)

Looking at the rows, all appear to have 3 columns properly filled. However, the methodConfig parameter entry has a particularly complex type definition that spans multiple lines in the rendered markdown, which could be causing the rendering issue being flagged.

The grammar issue is confirmed. I found the exact phrase in 4 component files:

  • RegisterMessageHandler.js: "optional pre and post execution logic"
  • RegisterErrorHandler.js: "optional pre and post execution logic"
  • HandleMessage.js: "optional pre and post execution logic"
  • CloseConnection.js: "optional pre and post execution logic"

These should all be changed to "pre- and post-execution" (with hyphens) in the source JSDoc comments.


Fix grammar in source JSDoc descriptions.

The generated API.md file correctly reflects issues in the source code. Update these 4 component files to use proper hyphenation:

  • packages/components/src/components/RegisterMessageHandler.js
  • packages/components/src/components/RegisterErrorHandler.js
  • packages/components/src/components/HandleMessage.js
  • packages/components/src/components/CloseConnection.js

Change "pre and post execution logic" to "pre- and post-execution logic" in each component's main JSDoc description.

🧰 Tools
🪛 LanguageTool

[grammar] ~2-~2: Use a hyphen to join words.
Context: ...ection method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~54-~54: Use a hyphen to join words.
Context: ...andler method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~150-~150: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)


[grammar] ~163-~163: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic.

Parameters

| Name...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)

4-4: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


17-17: Multiple headings with the same content

(MD024, no-duplicate-heading)


18-18: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


25-25: Multiple headings with the same content

(MD024, no-duplicate-heading)


26-26: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


34-34: Multiple headings with the same content

(MD024, no-duplicate-heading)


35-35: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


45-45: Multiple headings with the same content

(MD024, no-duplicate-heading)


46-46: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


55-55: Multiple headings with the same content

(MD024, no-duplicate-heading)


56-56: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


72-72: Multiple headings with the same content

(MD024, no-duplicate-heading)


73-73: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


86-86: Table column count
Expected: 3; Actual: 4; Too many cells, extra data will be missing

(MD056, table-column-count)


90-90: Multiple headings with the same content

(MD024, no-duplicate-heading)


91-91: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


102-102: Multiple headings with the same content

(MD024, no-duplicate-heading)


103-103: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


111-111: Multiple headings with the same content

(MD024, no-duplicate-heading)


112-112: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


118-118: Multiple headings with the same content

(MD024, no-duplicate-heading)


119-119: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


125-125: Multiple headings with the same content

(MD024, no-duplicate-heading)


126-126: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


134-134: Multiple headings with the same content

(MD024, no-duplicate-heading)


135-135: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


142-142: Multiple headings with the same content

(MD024, no-duplicate-heading)


143-143: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


151-151: Multiple headings with the same content

(MD024, no-duplicate-heading)


152-152: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


164-164: Multiple headings with the same content

(MD024, no-duplicate-heading)


165-165: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


177-177: Multiple headings with the same content

(MD024, no-duplicate-heading)


178-178: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

🤖 Prompt for AI Agents
In packages/components/API.md lines 1-183: the documentation flags inconsistent
hyphenation for "pre and post execution logic" originating from source JSDoc;
update the source JSDoc in the four component files to use the corrected
hyphenation "pre- and post-execution logic" — edit
packages/components/src/components/RegisterMessageHandler.js,
packages/components/src/components/RegisterErrorHandler.js,
packages/components/src/components/HandleMessage.js, and
packages/components/src/components/CloseConnection.js and replace the phrase
exactly in each component's main JSDoc description so the generated API.md
reflects the corrected wording.

/**
* Configuration for method syntax based on programming language.
* @type {Record<Language, { returnType?: string, openingTag?: string, closingTag?: string, indentSize?: number }>}
* @type {Record<Language, { returnType=: string, openingTag=: string, closingTag=: string, indentSize=: number }>}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix invalid JSDoc syntax and incorrect required properties.

The type annotation uses invalid =: syntax and incorrectly marks all properties as required. Based on the runtime configuration (lines 13-16), returnType, openingTag, and closingTag are optional—for example, JavaScript doesn't define returnType, and Python doesn't define closingTag.

Apply this diff:

-* @type {Record<Language, { returnType=: string, openingTag=: string, closingTag=: string, indentSize=: number }>}
+* @type {Record<Language, { returnType?: string, openingTag?: string, closingTag?: string, indentSize?: number, parameterWrap?: boolean }>}

Note: Also added the missing parameterWrap property that exists in the runtime config.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @type {Record<Language, { returnType=: string, openingTag=: string, closingTag=: string, indentSize=: number }>}
* @type {Record<Language, { returnType?: string, openingTag?: string, closingTag?: string, indentSize?: number, parameterWrap?: boolean }>}
🤖 Prompt for AI Agents
In packages/components/src/components/MethodGenerator.js around line 10, the
JSDoc type uses invalid `=:` syntax and incorrectly marks properties as
required; update the JSDoc to valid TypeScript-style object property annotations
and mark optional properties with `?`: e.g. change to something like `@type
{Record<Language, { returnType?: string, openingTag?: string, closingTag?:
string, indentSize: number, parameterWrap: string }>} ` so returnType,
openingTag and closingTag are optional, include the missing parameterWrap
property, and keep indentSize as required to match the runtime configuration.

Comment on lines +70 to +71
* @param {{ returnType: string, openingTag: string, closingTag: string, indentSize: number, parameterWrap: boolean }} [props.customMethodConfig] - Optional custom syntax configuration for the current language.
* @param {Record<Language, { methodDocs: string, methodLogic: string } | Record<string, { methodDocs: string, methodLogic: string }>>} [props.methodConfig] - Language-level or framework-level configuration.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix incorrect required properties in JSDoc.

The type annotations mark all properties as required, but based on the runtime behavior and the defaultMethodConfig fallback logic (lines 96-102), all properties in customMethodConfig should be optional. Similarly, methodDocs and methodLogic in methodConfig are optional based on the resolution logic (lines 31-35).

Apply this diff:

-* @param {{ returnType: string, openingTag: string, closingTag: string, indentSize: number, parameterWrap: boolean }} [props.customMethodConfig]  - Optional custom syntax configuration for the current language.
-* @param {Record<Language, { methodDocs: string, methodLogic: string } | Record<string, { methodDocs: string, methodLogic: string }>>} [props.methodConfig] - Language-level or framework-level configuration.
+* @param {{ returnType?: string, openingTag?: string, closingTag?: string, indentSize?: number, parameterWrap?: boolean }} [props.customMethodConfig]  - Optional custom syntax configuration for the current language.
+* @param {Record<Language, { methodDocs?: string, methodLogic?: string } | Record<string, { methodDocs?: string, methodLogic?: string }>>} [props.methodConfig] - Language-level or framework-level configuration.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param {{ returnType: string, openingTag: string, closingTag: string, indentSize: number, parameterWrap: boolean }} [props.customMethodConfig] - Optional custom syntax configuration for the current language.
* @param {Record<Language, { methodDocs: string, methodLogic: string } | Record<string, { methodDocs: string, methodLogic: string }>>} [props.methodConfig] - Language-level or framework-level configuration.
* @param {{ returnType?: string, openingTag?: string, closingTag?: string, indentSize?: number, parameterWrap?: boolean }} [props.customMethodConfig] - Optional custom syntax configuration for the current language.
* @param {Record<Language, { methodDocs?: string, methodLogic?: string } | Record<string, { methodDocs?: string, methodLogic?: string }>>} [props.methodConfig] - Language-level or framework-level configuration.
🤖 Prompt for AI Agents
In packages/components/src/components/MethodGenerator.js around lines 70 to 71,
the JSDoc types currently mark properties as required even though runtime logic
and defaultMethodConfig treat them as optional; update the JSDoc so
customMethodConfig's object properties are optional (e.g. returnType?: string,
openingTag?: string, closingTag?: string, indentSize?: number, parameterWrap?:
boolean) and adjust methodConfig so methodDocs and methodLogic are optional in
both the language-level shape and the nested framework-level shape (e.g.
methodDocs?: string, methodLogic?: string or Record<string, { methodDocs?:
string, methodLogic?: string }>), ensuring the annotations match the fallback
behavior.

Comment on lines 11 to 14
* @property {{ text: string, indent=: number, newLines=: number }} variableDefinition - Code block for variable initialization.
* @property {{ text: string, indent=: number, newLines=: number }} ifCondition - Conditional statement block.
* @property {{ text: string, indent=: number, newLines=: number }} assignment - Code block assigning query param.
* @property {{ text: string, indent=: number, newLines=: number } | null} [closing] - Optional closing block (for braces, etc.).
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix invalid JSDoc syntax.

The type annotations use =: syntax (e.g., indent=: number), which is invalid in JSDoc/TypeScript. The =: combination is not recognized by JSDoc parsers.

Based on the runtime configuration (lines 27-88), all three properties (text, indent, newLines) are consistently provided, so they should be required properties. The closing property can be null and should remain optional.

Apply this diff:

 * @typedef {Object} QueryParamCodeBlock
-* @property {{ text: string, indent=: number, newLines=: number }} variableDefinition - Code block for variable initialization.
-* @property {{ text: string, indent=: number, newLines=: number }} ifCondition - Conditional statement block.
-* @property {{ text: string, indent=: number, newLines=: number }} assignment - Code block assigning query param.
-* @property {{ text: string, indent=: number, newLines=: number } | null} [closing] - Optional closing block (for braces, etc.).
+* @property {{ text: string, indent: number, newLines: number }} variableDefinition - Code block for variable initialization.
+* @property {{ text: string, indent: number, newLines: number }} ifCondition - Conditional statement block.
+* @property {{ text: string, indent: number, newLines: number }} assignment - Code block assigning query param.
+* @property {{ text: string, indent: number, newLines: number } | null} [closing] - Optional closing block (for braces, etc.).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @property {{ text: string, indent=: number, newLines=: number }} variableDefinition - Code block for variable initialization.
* @property {{ text: string, indent=: number, newLines=: number }} ifCondition - Conditional statement block.
* @property {{ text: string, indent=: number, newLines=: number }} assignment - Code block assigning query param.
* @property {{ text: string, indent=: number, newLines=: number } | null} [closing] - Optional closing block (for braces, etc.).
* @property {{ text: string, indent: number, newLines: number }} variableDefinition - Code block for variable initialization.
* @property {{ text: string, indent: number, newLines: number }} ifCondition - Conditional statement block.
* @property {{ text: string, indent: number, newLines: number }} assignment - Code block assigning query param.
* @property {{ text: string, indent: number, newLines: number } | null} [closing] - Optional closing block (for braces, etc.).
🤖 Prompt for AI Agents
In packages/components/src/components/QueryParamsVariables.js around lines 11 to
14, the JSDoc uses invalid `=:` syntax for typing (e.g., `indent=: number`) and
incorrectly marks properties as optional; update the JSDoc to use valid
JSDoc/TypeScript style (e.g., `indent: number`, `newLines: number`, `text:
string`) making text, indent, and newLines required, and keep closing as an
optional property that can be null (e.g., `{ { text: string, indent: number,
newLines: number } | null } [closing]`), ensuring the annotations match the
runtime usage.

/**
* Configuration for WebSocket error handler registration method logic per language.
* @type {Record<Language, { methodDocs?: string, methodLogic: string }>}
* @type {Record<Language, { methodDocs=: string, methodLogic: string }>}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix invalid JSDoc syntax.

The type annotation uses methodDocs=: string, which is invalid JSDoc/TypeScript syntax. Based on the runtime configuration where methodDocs is absent in the python entry, this should be an optional property.

Apply this diff:

-* @type {Record<Language, { methodDocs=: string, methodLogic: string }>}
+* @type {Record<Language, { methodDocs?: string, methodLogic: string }>}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @type {Record<Language, { methodDocs=: string, methodLogic: string }>}
* @type {Record<Language, { methodDocs?: string, methodLogic: string }>}
🤖 Prompt for AI Agents
In packages/components/src/components/RegisterErrorHandler.js around line 10,
the JSDoc type annotation is invalid because it uses "methodDocs=: string";
change the property to be optional and valid by replacing that fragment with
"methodDocs?: string" so the type becomes Record<Language, { methodDocs?:
string, methodLogic: string }>, reflecting that python entries may omit
methodDocs.

Copy link

@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

♻️ Duplicate comments (1)
packages/components/API.md (1)

1-193: Update JSDoc comments in four component files to correct hyphenation.

The auto-generated API.md reflects the current state of JSDoc comments in source files. Verification confirms that grammar issues identified in the previous review have not yet been fixed. Update "pre and post execution" to "pre- and post-execution" in the following files:

  • packages/components/src/components/CloseConnection.js
  • packages/components/src/components/HandleMessage.js
  • packages/components/src/components/RegisterErrorHandler.js
  • packages/components/src/components/RegisterMessageHandler.js

Once source JSDoc is corrected, the auto-generated API.md will reflect these changes.

🧹 Nitpick comments (1)
packages/components/package.json (1)

15-19: Consider adding API.md to the published package files.

The files array currently excludes the auto-generated API.md. Since this is user-facing API documentation, consider whether it should be included in npm package distributions for end-users to reference.

If API.md should be published, add it to the files array:

   "files": [
     "lib/**",
     "README.md",
+    "API.md",
     "LICENSE"
   ],

Alternatively, if API.md is only for the repository, ensure it's in .gitignore and document this decision.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 810948d and 431b8d1.

📒 Files selected for processing (3)
  • packages/components/API.md (1 hunks)
  • packages/components/api.hbs (1 hunks)
  • packages/components/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/components/api.hbs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-04-23T09:18:38.333Z
Learnt from: derberg
Repo: asyncapi/generator PR: 1512
File: packages/templates/clients/websocket/javascript/components/AvailableOperations.js:10-15
Timestamp: 2025-04-23T09:18:38.333Z
Learning: In the asyncapi/generator repository, keys aren't required when mapping over operations array in the AvailableOperations component, contrary to the typical React pattern.

Applied to files:

  • packages/components/package.json
📚 Learning: 2025-05-12T14:57:35.024Z
Learnt from: Adi-204
Repo: asyncapi/generator PR: 1557
File: packages/templates/clients/websocket/javascript/components/SendOperation.js:21-21
Timestamp: 2025-05-12T14:57:35.024Z
Learning: In the AsyncAPI generator templates, particularly in the JavaScript WebSocket client, single quotes are used for string literals inside template-generated code (which is itself inside backticks) to preserve template placeholders like ${variable} as literal text in the generated code output.

Applied to files:

  • packages/components/API.md
🪛 LanguageTool
packages/components/API.md

[grammar] ~2-~2: Use a hyphen to join words.
Context: ...ection method with optional pre and post execution logic. ### Parameters | Name |...

(QB_NEW_EN_HYPHEN)


[grammar] ~58-~58: Use a hyphen to join words.
Context: ...andler method with optional pre and post execution logic. ### Parameters | Name |...

(QB_NEW_EN_HYPHEN)


[grammar] ~157-~157: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic. ### Parameters | Name |...

(QB_NEW_EN_HYPHEN)


[grammar] ~171-~171: Use a hyphen to join words.
Context: ...ration method with optional pre and post execution logic. ### Parameters | Name |...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
packages/components/API.md

4-4: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


18-18: Multiple headings with the same content

(MD024, no-duplicate-heading)


19-19: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


26-26: Multiple headings with the same content

(MD024, no-duplicate-heading)


27-27: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


33-33: Multiple headings with the same content

(MD024, no-duplicate-heading)


36-36: Multiple headings with the same content

(MD024, no-duplicate-heading)


37-37: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


45-45: Multiple headings with the same content

(MD024, no-duplicate-heading)


48-48: Multiple headings with the same content

(MD024, no-duplicate-heading)


49-49: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


56-56: Multiple headings with the same content

(MD024, no-duplicate-heading)


59-59: Multiple headings with the same content

(MD024, no-duplicate-heading)


60-60: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


70-70: Multiple headings with the same content

(MD024, no-duplicate-heading)


77-77: Multiple headings with the same content

(MD024, no-duplicate-heading)


78-78: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


91-91: Table column count
Expected: 3; Actual: 4; Too many cells, extra data will be missing

(MD056, table-column-count)


95-95: Multiple headings with the same content

(MD024, no-duplicate-heading)


96-96: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


105-105: Multiple headings with the same content

(MD024, no-duplicate-heading)


108-108: Multiple headings with the same content

(MD024, no-duplicate-heading)


109-109: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


117-117: Multiple headings with the same content

(MD024, no-duplicate-heading)


118-118: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


124-124: Multiple headings with the same content

(MD024, no-duplicate-heading)


125-125: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


131-131: Multiple headings with the same content

(MD024, no-duplicate-heading)


132-132: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


140-140: Multiple headings with the same content

(MD024, no-duplicate-heading)


141-141: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


146-146: Multiple headings with the same content

(MD024, no-duplicate-heading)


149-149: Multiple headings with the same content

(MD024, no-duplicate-heading)


150-150: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


158-158: Multiple headings with the same content

(MD024, no-duplicate-heading)


159-159: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


169-169: Multiple headings with the same content

(MD024, no-duplicate-heading)


172-172: Multiple headings with the same content

(MD024, no-duplicate-heading)


173-173: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


182-182: Multiple headings with the same content

(MD024, no-duplicate-heading)


186-186: Multiple headings with the same content

(MD024, no-duplicate-heading)


187-187: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

🔇 Additional comments (1)
packages/components/package.json (1)

43-43: Dependency version is appropriate.

The jsdoc-to-markdown v9.1.3 version with caret constraint ^9.1.3 is suitable for this use case, allowing patch and minor updates while maintaining stability.

@batchu5 batchu5 force-pushed the api-generation-for-components branch from ef164c0 to c521c81 Compare November 23, 2025 17:00
Copy link

@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 (1)
packages/components/package.json (1)

15-19: Consider adding API.md to the published files array.

The API.md file is generated by the docs script and added to the published package alongside README.md and LICENSE. Confirm whether it should be included in the files array for distribution to package consumers.

If API.md is meant to be published, apply this diff:

  "files": [
    "lib/**",
    "README.md",
+   "API.md",
    "LICENSE"
  ],
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef164c0 and c521c81.

📒 Files selected for processing (1)
  • packages/components/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-23T09:18:38.333Z
Learnt from: derberg
Repo: asyncapi/generator PR: 1512
File: packages/templates/clients/websocket/javascript/components/AvailableOperations.js:10-15
Timestamp: 2025-04-23T09:18:38.333Z
Learning: In the asyncapi/generator repository, keys aren't required when mapping over operations array in the AvailableOperations component, contrary to the typical React pattern.

Applied to files:

  • packages/components/package.json
🔇 Additional comments (1)
packages/components/package.json (1)

12-13: Cross-platform script fixes and glob quoting are correctly applied.

The scripts properly use && for sequential execution (addressing the prior Unix-only & issue) and the glob pattern is correctly quoted for cross-platform compatibility. The workflow ensures docs runs after prepublishOnly to generate API documentation.

"@babel/preset-react": "^7.25.9",
"jest": "^27.3.1",
"jest-esm-transformer": "^1.0.0",
"jsdoc-to-markdown": "^9.1.3"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify jsdoc-to-markdown v9.1.3 is actively maintained and free from vulnerabilities.

The version pinning strategy (caret ^9.1.3) allows patch and minor updates. Ensure this version resolves the JSDoc type parsing issue mentioned in the PR (optional-property marker ? in Record types) and is free from security advisories.


🌐 Web query:

Does jsdoc-to-markdown v9.1.3 support optional property markers in JSDoc Record types, and are there known security advisories for this version?

💡 Result:

Short answer:

  • No — jsdoc-to-markdown (v9.1.3) does not add special support for "question‑mark" optional property markers inside JSDoc record type syntax; JSDoc/Closure-style record types generally require either the square-bracket property form ([@Property {T} [name]]) or an explicit union with undefined (e.g. T|undefined). (jsdoc.app)

  • No known public security advisories specific to jsdoc-to-markdown v9.1.3 were reported in major vulnerability trackers (Snyk / npm metadata) at the time of checking. (security.snyk.io)

If you want, I can show an example JSDoc workaround (square-bracket/@Property or |undefined) and a quick scan of your project for indirect dependency advisories.

Citations:


Dependency version does not support the stated JSDoc optional-property marker feature.

Web verification confirms that jsdoc-to-markdown v9.1.3 does not support optional property markers (?) in JSDoc Record types—the standard workarounds require square-bracket syntax or explicit undefined unions instead. If the PR intends to resolve the optional-property marker parsing issue via this dependency upgrade, v9.1.3 will not achieve that. No security advisories were found for this version.

🤖 Prompt for AI Agents
In packages/components/package.json at line 43, the dependency
jsdoc-to-markdown@^9.1.3 does not support JSDoc Record optional-property marker
(`?`), so the upgrade will not fix parsing of `?` in Record types; either update
the dependency to a version that explicitly adds support for `?` (verify release
notes/changelog before bumping) or revert this change and instead update the
source JSDoc to use supported alternatives (square-bracket optional syntax or
explicit `| undefined` unions) and add a comment in the package.json/change log
explaining why the dependency was not upgraded.

Copy link
Author

@batchu5 batchu5 Nov 24, 2025

Choose a reason for hiding this comment

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

so should i replace the '?' mark with sqaure brackets

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce API generation for components

2 participants