Skip to content

Conversation

@avivkeller
Copy link
Member

Ref: #462

This PR allows the user to pass a custom --type-map argument, while falling back to the predefined one.

@avivkeller avivkeller requested a review from a team as a code owner October 12, 2025 19:01
Copilot AI review requested due to automatic review settings October 12, 2025 19:01
@vercel
Copy link

vercel bot commented Oct 12, 2025

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

Project Deployment Preview Updated (UTC)
api-docs-tooling Ready Ready Preview Oct 19, 2025 1:58pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for custom type mapping by allowing users to pass a --type-map argument while maintaining backward compatibility with the predefined type mappings. The implementation threads a typeMap parameter through the API documentation parsing pipeline to enable custom type-to-link transformations.

  • Added typeMap parameter to key functions in the parsing and generation pipeline
  • Modified transformTypeToReferenceLink to accept an optional custom type mapping record
  • Added test coverage for the custom type mapping functionality

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/queries/index.mjs Updated createQueries to accept and pass through typeMap parameter
src/utils/parser/index.mjs Modified transformTypeToReferenceLink to accept optional custom type mapping
src/utils/parser/tests/index.test.mjs Added test case for custom type mapping functionality
src/generators/metadata/utils/parse.mjs Updated parseApiDoc to accept and pass through typeMap parameter
src/generators/metadata/index.mjs Modified generator to accept typeMap from options and pass to parser

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 12, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.01%. Comparing base (3291812) to head (79abefb).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
bin/commands/generate.mjs 70.58% 5 Missing ⚠️
src/generators/metadata/index.mjs 66.66% 1 Missing ⚠️
src/generators/metadata/utils/parse.mjs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #463      +/-   ##
==========================================
- Coverage   74.55%   74.01%   -0.55%     
==========================================
  Files         107      108       +1     
  Lines       10466    10316     -150     
  Branches      684      685       +1     
==========================================
- Hits         7803     7635     -168     
- Misses       2661     2678      +17     
- Partials        2        3       +1     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Member Author

Bump @nodejs/web-infra

@avivkeller avivkeller requested review from a team and ovflowd October 18, 2025 15:45
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM, left a few comments

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM, left one final nit 😅

@avivkeller avivkeller merged commit 8375d8c into main Oct 19, 2025
18 of 19 checks passed
@avivkeller avivkeller deleted the type-map branch October 19, 2025 13:56
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.

3 participants