Skip to content

chore(parsing): better use of code spans#840

Draft
avivkeller wants to merge 1 commit into
mainfrom
better-type-parsing-output
Draft

chore(parsing): better use of code spans#840
avivkeller wants to merge 1 commit into
mainfrom
better-type-parsing-output

Conversation

@avivkeller

@avivkeller avivkeller commented Jun 15, 2026

Copy link
Copy Markdown
Member

Fixes #839 by only outputting the code spans on the outermost resolution

Note: This changes the output slightly, from <MyType> to <MyType>

@avivkeller avivkeller requested a review from a team as a code owner June 15, 2026 20:33
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Error Error Jun 15, 2026 9:25pm

Request Review

@cursor

cursor Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Output-format change for generated docs only; behavior is covered by updated unit tests with no runtime API changes.

Overview
Refactors metadata type-to-markdown parsing so one outer <code><…></code> wraps the whole type instead of nesting backticks around every linked segment.

parseInner now builds plain inner markup: type links become [Name](url) (no `[`<Name>`]`), generics and => use literal characters instead of HTML entities, and unresolved names stay as bare text. The exported parseType only adds the outer code wrapper. Test expectations in transformers.test.mjs are updated to match the new rendered shape (fixes #839).

Reviewed by Cursor Bugbot for commit f394719. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort 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.

Reviewed by Cursor Bugbot for commit f394719. Configure here.

if (inner === null) {
return null;
}
return `<code><${inner}></code>`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Type output breaks typed list parsing

High Severity

Wrapping resolved types as <code><…></code> with inner markdown links like [string](url) no longer matches what downstream code expects: link nodes whose child is inlineCode starting with <. Typed parameter lists then fail strongly-typed detection and extractTypeAnnotations leaves type unset, so signature tables and legacy HTML type-link handling break.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f394719. Configure here.

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.60%. Comparing base (f97991b) to head (f394719).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
src/generators/metadata/utils/typeParser.mjs 84.61% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #840      +/-   ##
==========================================
+ Coverage   82.80%   84.60%   +1.80%     
==========================================
  Files         171      176       +5     
  Lines       14904    15813     +909     
  Branches     1305     1412     +107     
==========================================
+ Hits        12341    13379    +1038     
+ Misses       2555     2424     -131     
- Partials        8       10       +2     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller avivkeller marked this pull request as draft June 15, 2026 21:37
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.

typeParser.mjs should place functions within code blocks.

2 participants