Skip to content

feat: generate JSDoc comments from schema descriptions (including @deprecated)#348

Open
jonaslagoni wants to merge 9 commits intomainfrom
issue-338-generate-jsdoc-comments-from-s
Open

feat: generate JSDoc comments from schema descriptions (including @deprecated)#348
jonaslagoni wants to merge 9 commits intomainfrom
issue-338-generate-jsdoc-comments-from-s

Conversation

@jonaslagoni
Copy link
Contributor

@jonaslagoni jonaslagoni commented Mar 13, 2026

Summary

Resolves #338

See implementation details in .claude/thoughts/issue-338-generate-jsdoc-comments-from-s-2026-03-13/plan.md

Test Plan

  • All unit tests pass
  • All runtime tests pass
  • npm run prepare:pr passes

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk because it changes TypeScript code generation output across multiple protocols and payload models; downstream consumers may see doc/comment diffs and potential formatting edge cases (multiline/*/ escaping) despite no runtime behavior changes intended.

Overview
Adds spec-driven JSDoc to generated TypeScript channel/client functions across HTTP, WebSocket, EventSource, AMQP, Kafka, MQTT, and NATS by plumbing description/deprecated metadata into renderers and centralizing formatting in renderChannelJSDoc (with escaping and optional @deprecated).

Extends payload model generation to emit property/class documentation via Modelina’s TS_DESCRIPTION_PRESET, and removes the old renderJSDocParameters helper.

Updates/expands tests and snapshots to assert the new JSDoc output, adds unit tests for the new JSDoc utilities, and relaxes init command tests to ignore Node.js deprecation warnings on stderr.

Written by Cursor Bugbot for commit 8c44ad2. This will update automatically on new commits. Configure here.

…precated)

Resolves #338

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jonaslagoni jonaslagoni requested a review from ALagoni97 as a code owner March 13, 2026 15:21
@netlify
Copy link

netlify bot commented Mar 13, 2026

Deploy Preview for the-codegen-project canceled.

Name Link
🔨 Latest commit 8c44ad2
🔍 Latest deploy log https://app.netlify.com/projects/the-codegen-project/deploys/69b433b85ed3b4000884a8c9

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Mar 13, 2026 3:58pm
the-codegen-project-mcp Ready Ready Preview, Comment Mar 13, 2026 3:58pm

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jonaslagoni jonaslagoni changed the title feat: Generate JSDoc comments from schema descriptions (including @deprecated) feat: generate JSDoc comments from schema descriptions (including @deprecated) Mar 13, 2026
Removed the 'export' keyword from the generated HTTP client function
declaration to match the pattern used by all other protocol renderers
(NATS, Kafka, MQTT, AMQP, WebSocket, EventSource), which use separate
export statements at the bottom of the file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates test snapshots to match the HTTP client function signature
change from the previous commit that removed the 'export' keyword
from generated HTTP client functions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The init command tests were failing in CI because Node.js outputs
deprecation warnings (like the punycode module warning) to stderr.
The tests were asserting stderr === '', which failed when these
warnings were present.

Added a helper function `expectNoActualErrors()` that filters out
Node.js deprecation warnings while still failing on actual errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add escapeJSDocDescription to renderJSDocParameters for parameter descriptions
- Apply escapeJSDocDescription to fallbackDescription in renderChannelJSDoc

This prevents JSDoc comment blocks from breaking when API spec descriptions
contain `*/` (comment terminator) or newlines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the unused renderJSDocParameters function from utils.ts and its
corresponding tests. This function was never imported or called in
production code - only the test file used it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused escapeJSDocDescription import from utils.ts
- Remove extra blank line before realizeChannelName function
- Remove blank line padding in test block

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The name field was declared in the parameters type but never accessed
inside the function - only jsDoc was used. Removing it eliminates
unnecessary boilerplate across all protocol files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Generate JSDoc comments from schema descriptions (including @deprecated)

1 participant