Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Dec 22, 2025

  • Stability nodes are no longer assumed to be the first element under a heading, and are instead found via .findIndex
  • property detection now properly assigns .type without changing the property type to misc (via the addition of a new __promote property)
  • Our RegEx now identifies functions without a preceding module name (i.e. init() will now be matched alongside my_module.init())
  • Method names with symbols (i.e. myMethod[Symbol()](props)) are now corrected
  • Fixes The content of the third-level table has been truncated. #527
  • napi versions are correctly treated as numbers, and not string[]

Copilot AI review requested due to automatic review settings December 22, 2025 18:13
@avivkeller avivkeller requested a review from a team as a code owner December 22, 2025 18:13
@vercel
Copy link

vercel bot commented Dec 22, 2025

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

Project Deployment Review Updated (UTC)
api-docs-tooling Ready Ready Preview Dec 24, 2025 9:55pm

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 85.61151% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.86%. Comparing base (776dd0b) to head (6c0bfd5).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/legacy-json/utils/buildSection.mjs 7.69% 12 Missing ⚠️
...rc/generators/jsx-ast/utils/buildPropertyTable.mjs 33.33% 4 Missing ⚠️
src/generators/jsx-ast/utils/buildContent.mjs 0.00% 1 Missing ⚠️
src/generators/jsx-ast/utils/buildSignature.mjs 0.00% 1 Missing ⚠️
src/generators/legacy-json/utils/parseList.mjs 92.30% 1 Missing ⚠️
src/utils/queries/index.mjs 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   79.82%   79.86%   +0.03%     
==========================================
  Files         121      122       +1     
  Lines       12017    12060      +43     
  Branches      840      843       +3     
==========================================
+ Hits         9593     9632      +39     
- Misses       2421     2425       +4     
  Partials        3        3              

☔ 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.

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 improves the legacy JSON generator to produce output that more closely matches the expected format. The changes address discrepancies found in the first 7 files alphabetically during testing.

Key changes:

  • Enhanced regex pattern to match methods without a module name prefix (e.g., init() alongside module.init())
  • Refactored property type assignment to preserve both the parsed type and the original property classification using a __promote marker
  • Improved stability node detection to use findIndex instead of assuming the first position

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/utils/parser/constants.mjs Updated method regex to match functions with or without module/property prefixes
src/generators/legacy-json/utils/parseList.mjs Changed property handling to use Object.assign with __promote marker to preserve type information
src/generators/legacy-json/utils/buildSection.mjs Refactored stability parsing to use findIndex and updated addToParent to respect __promote marker

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avivkeller avivkeller marked this pull request as draft December 22, 2025 18:28
@avivkeller
Copy link
Member Author

avivkeller commented Dec 22, 2025

[Draft while I finish looking for differences. Currently at: tracing]

Possible TODOs for a follow-up:

  • legacy-json does not generate Stability Index (neither does web, fwiw)

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! Although tests are failing!

@avivkeller
Copy link
Member Author

Although tests are failing!

Yes, I'm aware. I'm going to fix them once I go through each file and confirm the diff (it's a slow process...)

@avivkeller avivkeller linked an issue Dec 23, 2025 that may be closed by this pull request
@avivkeller
Copy link
Member Author

(Once complete, this PR will resolve that issue, since this is a regression from the old tooling to our tooling)

@ovflowd
Copy link
Member

ovflowd commented Dec 23, 2025

Unrelated-ish, due to how human eyes work, when looking at these (on the page) the method signature width feels smaller than the stability index one, and that's simply due to the fact that stability index component doesn't has a border with a different colour. Could we have all our stability indexes banners to also have a border in their respective accent colour?

image

@ovflowd
Copy link
Member

ovflowd commented Dec 23, 2025

Unrelated-ish, due to how human eyes work, when looking at these (on the page) the method signature width feels smaller than the stability index one, and that's simply due to the fact that stability index component doesn't has a border with a different colour. Could we have all our stability indexes banners to also have a border in their respective accent colour?

image

Another possible fix is simply having the border accent of the method banner to be a stronger accent colour.

@avivkeller avivkeller marked this pull request as ready for review December 23, 2025 16:10
@avivkeller avivkeller force-pushed the more-identical-legacy-json branch from 1ad05ee to 842c8f6 Compare December 23, 2025 16:10
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avivkeller avivkeller requested a review from a team December 23, 2025 20:10
@ovflowd
Copy link
Member

ovflowd commented Dec 23, 2025

Unrelated-ish, due to how human eyes work, when looking at these (on the page) the method signature width feels smaller than the stability index one, and that's simply due to the fact that stability index component doesn't has a border with a different colour. Could we have all our stability indexes banners to also have a border in their respective accent colour?
image

Another possible fix is simply having the border accent of the method banner to be a stronger accent colour.

Can we make the border colour of the signature methods be the same of tables? That is a strong border colour.

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! Changes look good. Please if possible add tests covering the new scenarios and edge cases these changes are supposed to cover :)

'classMethod',
];

export const TRIMMABLE_PADDING_REGEX = /^[\s:]+/;
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have a specific file for regex constants? Also fine if this stays as is.

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.

The content of the third-level table has been truncated.

3 participants