Skip to content

Conversation

@ovflowd
Copy link
Member

@ovflowd ovflowd commented Feb 11, 2026

Description

This PR implements design improvements and infrastructure changes for the web generator, addressing feedback tracked in #596.

Depends on nodejs/nodejs.org#8618 (Build will fail before this PR gets merged)

Summary of Changes

1. Resolve @node-core/ui-components compiled dist via Rolldown condition

Added conditionNames: ['rolldown'] to the Rolldown resolve configuration in bundle.mjs. This makes Rolldown resolve from the dist/ directory of @node-core/ui-components via the new "rolldown" export condition, consuming pre-compiled JS and CSS instead of raw Tailwind source files.

Also disabled pluginTimings checks for cleaner build output.

2. Heading anchor structure for # indicator

Changed the heading generation in buildContent.mjs from:

<h2><a id="slug" href="#slug"></a></h2>

to:

<h2 id="slug"><a href="#slug" class="anchor"></a></h2>

This enables the CSS-only # anchor indicator added in @node-core/ui-components (.anchor::after { content: '#' }) and proper scroll-margin-top behavior on headings.

3. Heading type data for monospace ToC entries

Added the type field to heading data in buildBarProps.mjs so that the MetaBar and TableOfContents components can apply monospace font (IBM Plex Mono) to code-like headings (methods, constructors, class methods, functions).

4. Stability badge tooltips in MetaBar

Added tooltip text to stability badges in the MetaBar heading list. The HeadingValue component now passes data-tooltip (e.g. "Deprecated", "Experimental", "Legacy") and aria-label to Badge, leveraging the new CSS-only tooltip support added in @node-core/ui-components.

5. Type cleanup

  • Removed unused ApiDocReleaseEntry import from types.d.ts
  • Added @types/semver dev dependency

Refs: #596
Refs: nodejs/node#52343

Copilot AI review requested due to automatic review settings February 11, 2026 00:59
@ovflowd ovflowd requested a review from a team as a code owner February 11, 2026 00:59
@vercel
Copy link

vercel bot commented Feb 11, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Feb 11, 2026 1:03am

Request Review

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.54%. Comparing base (6ec9047) to head (6ca168f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/web/utils/bundle.mjs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
- Coverage   80.59%   80.54%   -0.05%     
==========================================
  Files         126      126              
  Lines       12134    12148      +14     
  Branches      874      874              
==========================================
+ Hits         9779     9785       +6     
- Misses       2352     2360       +8     
  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 updates the web generator output and bundling configuration to align with recent @node-core/ui-components changes, improving heading anchors/ToC rendering and adding stability badge tooltips, while also adjusting the build pipeline to consume precompiled UI component assets.

Changes:

  • Update Rolldown bundling config to use a rolldown export condition and suppress plugin timing logs.
  • Change generated heading markup to put id on the heading element and add an .anchor link for CSS-driven # indicators and improved scroll behavior.
  • Propagate heading type metadata for monospace ToC entries and add tooltip/ARIA attributes to stability badges in MetaBar; plus minor type/dependency cleanup.

Reviewed changes

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

Show a summary per file
File Description
src/generators/web/utils/bundle.mjs Adjust Rolldown build options and export-condition resolution.
src/generators/web/ui/components/MetaBar/index.jsx Add tooltip/ARIA support for stability badges via a small helper component.
src/generators/types.d.ts Remove unused type import.
src/generators/jsx-ast/utils/buildContent.mjs Change heading/anchor structure to support CSS-only # indicator and correct scroll targeting.
src/generators/jsx-ast/utils/buildBarProps.mjs Add type to heading metadata for downstream ToC/MetaBar styling decisions.
package.json Add @types/semver dev dependency.
Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported

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

Comment on lines +126 to +134
createElement(
`h${depth}`,
{ id: slug },
createElement(
'a',
{ href: `#${slug}`, className: ['anchor'] },
headingContent
)
),
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The heading anchor structure changed (id moved to the hN element and .anchor class added). Since buildContent.mjs already has unit tests, it would be good to add/extend a test to assert the generated HAST for a heading contains h{depth} with properties.id === slug and an a child with properties.href === #${slug}andproperties.classNameincludinganchor`, to prevent regressions in anchor behavior and styling.

Copilot uses AI. Check for mistakes.
Comment on lines 66 to 72
return {
depth: entry.heading.depth,
value: heading,
stability: parseInt(entry.stability?.children[0]?.data.index ?? 2),
slug: data.slug,
data: { id: data.slug },
data: { id: data.slug, type: data.type },
};
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

extractHeading() now adds data.type to the heading metadata to drive monospace styling in the ToC/MetaBar. Since buildBarProps.mjs has existing unit tests, consider adding an assertion in buildBarProps.test.mjs that buildMetaBarProps(...).headings[0].data.type is set when the input heading.data.type is present, so this new contract is covered.

Copilot uses AI. Check for mistakes.
"@reporters/github": "^1.12.0",
"@types/mdast": "^4.0.4",
"@types/node": "^24.10.1",
"@types/semver": "^7.7.1",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

package.json adds a new dependency (@types/semver), but the repo also commits npm-shrinkwrap.json. If the shrinkwrap file isn’t updated in the same PR, npm ci/install steps will typically fail due to the lockfile being out of sync. Please regenerate/update npm-shrinkwrap.json to include this new package (and any transitive changes).

Suggested change
"@types/semver": "^7.7.1",

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

api-links Generator

apilinks.json
Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines

  {
    'Agent.defaultMaxSockets': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L227',
    'Buffer.alloc': 'https://github.com/nodejs/node/tree/HEAD/lib/buffer.js#L431',
    'Buffer.allocUnsafe': 'https://github.com/nodejs/node/tree/HEAD/lib/buffer.js#L445',
    'Buffer.allocUnsafeSlow': 'https://github.com/nodejs/node/tree/HEAD/lib/buffer.js#L457',
...
    'agent.addRequest': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L292',
+   'agent.createConnection': 'https://github.com/nodejs/node/tree/HEAD/lib/https.js#L326',
-   'agent.createConnection': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L231',
    'agent.createSocket': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L363',
    'agent.destroy': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L595',
+   'agent.getName': 'https://github.com/nodejs/node/tree/HEAD/lib/https.js#L484',
-   'agent.getName': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L261',
    'agent.keepSocketAlive': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L552',
    'agent.removeSocket': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L491',
    'agent.reuseSocket': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_agent.js#L588',
    'assert.assert': 'https://github.com/nodejs/node/tree/HEAD/lib/assert.js#L185',
    'asyncResource.asyncId': 'https://github.com/nodejs/node/tree/HEAD/lib/async_hooks.js#L242',
...
    'server.address': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2297',
+   'server.close': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2430',
+   'server.closeAllConnections': 'https://github.com/nodejs/node/tree/HEAD/lib/https.js#L120',
+   'server.closeIdleConnections': 'https://github.com/nodejs/node/tree/HEAD/lib/https.js#L122',
-   'server.close': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L611',
-   'server.closeAllConnections': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L621',
-   'server.closeIdleConnections': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L633',
    'server.getConnections': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2392',
    'server.listen': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2114',
    'server.ref': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2535',
+   'server.setTimeout': 'https://github.com/nodejs/node/tree/HEAD/lib/https.js#L124',
-   'server.setTimeout': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L649',
    'server.unref': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2544',
+   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2470',
+   'server[undefined]': 'https://github.com/nodejs/node/tree/HEAD/lib/net.js#L2499',
-   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L617',
-   'server[undefined]': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L656',
    'serverresponse._finish': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L244',
    'serverresponse._implicitHeader': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L351',
    'serverresponse.assignSocket': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L294',
    'serverresponse.detachSocket': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L305',
    'serverresponse.statusCode': 'https://github.com/nodejs/node/tree/HEAD/lib/_http_server.js#L267',

web Generator

File Base Head Diff
errors.js 394.91 KB 414.40 KB +19.49 KB (+4.94%)
fs.js 1.33 MB 1.33 MB +10.04 KB (+0.74%)
cli.js 316.81 KB 326.74 KB +9.93 KB (+3.13%)
deprecations.js 298.93 KB 307.33 KB +8.40 KB (+2.81%)
http.js 736.86 KB 745.17 KB +8.31 KB (+1.13%)
crypto.js 1.24 MB 1.24 MB +7.58 KB (+0.60%)
n-api.js 718.60 KB 725.76 KB +7.16 KB (+1.00%)
quic.js 213.24 KB 220.39 KB +7.16 KB (+3.36%)
errors.html 449.48 KB 456.39 KB +6.90 KB (+1.54%)
cli.html 491.96 KB 497.80 KB +5.85 KB (+1.19%)
process.js 745.31 KB 751.12 KB +5.81 KB (+0.78%)
buffer.js 1.13 MB 1.14 MB +5.70 KB (+0.49%)
test.js 877.65 KB 883.24 KB +5.60 KB (+0.64%)
util.js 795.73 KB 800.95 KB +5.22 KB (+0.66%)
webcrypto.js 460.15 KB 465.35 KB +5.20 KB (+1.13%)
perf_hooks.js 401.99 KB 407.02 KB +5.03 KB (+1.25%)
net.js 317.58 KB 322.23 KB +4.65 KB (+1.47%)
http2.js 855.06 KB 859.35 KB +4.30 KB (+0.50%)
fs.html 1.26 MB 1.27 MB +4.27 KB (+0.33%)
globals.js 135.40 KB 139.54 KB +4.13 KB (+3.05%)
stream.js 908.74 KB 912.67 KB +3.93 KB (+0.43%)
tls.js 346.66 KB 350.22 KB +3.56 KB (+1.03%)
n-api.html 819.12 KB 822.41 KB +3.29 KB (+0.40%)
zlib.js 331.93 KB 335.12 KB +3.19 KB (+0.96%)
worker_threads.js 419.45 KB 422.63 KB +3.18 KB (+0.76%)
http.html 697.97 KB 701.05 KB +3.08 KB (+0.44%)
events.js 575.78 KB 578.74 KB +2.96 KB (+0.51%)
process.html 643.55 KB 646.38 KB +2.84 KB (+0.44%)
webcrypto.html 511.27 KB 514.00 KB +2.72 KB (+0.53%)
v8.js 353.56 KB 356.22 KB +2.67 KB (+0.75%)
webstreams.js 319.24 KB 321.84 KB +2.60 KB (+0.82%)
crypto.html 972.52 KB 975.12 KB +2.60 KB (+0.27%)
deprecations.html 503.65 KB 506.18 KB +2.54 KB (+0.50%)
dns.js 290.89 KB 293.39 KB +2.50 KB (+0.86%)
sqlite.js 239.83 KB 242.21 KB +2.38 KB (+0.99%)
http2.html 722.49 KB 724.83 KB +2.34 KB (+0.32%)
quic.html 345.34 KB 347.68 KB +2.34 KB (+0.68%)
buffer.html 844.88 KB 847.05 KB +2.16 KB (+0.26%)
vm.js 379.42 KB 381.56 KB +2.14 KB (+0.56%)
url.js 354.23 KB 356.27 KB +2.04 KB (+0.57%)
globals.html 222.32 KB 224.32 KB +2.00 KB (+0.90%)
stream.html 813.73 KB 815.72 KB +1.99 KB (+0.24%)
test.html 675.99 KB 677.98 KB +1.99 KB (+0.29%)
child_process.js 489.15 KB 491.10 KB +1.95 KB (+0.40%)
util.html 649.99 KB 651.90 KB +1.91 KB (+0.29%)
readline.js 237.93 KB 239.83 KB +1.91 KB (+0.80%)
esm.js 138.68 KB 140.40 KB +1.72 KB (+1.24%)
module.js 351.39 KB 353.11 KB +1.72 KB (+0.49%)
dgram.js 183.96 KB 185.67 KB +1.71 KB (+0.93%)
zlib.html 273.22 KB 274.90 KB +1.69 KB (+0.62%)
modules.js 157.39 KB 159.04 KB +1.66 KB (+1.05%)
inspector.js 131.56 KB 133.21 KB +1.66 KB (+1.26%)
cluster.js 206.04 KB 207.65 KB +1.61 KB (+0.78%)
diagnostics_channel.js 252.55 KB 254.15 KB +1.60 KB (+0.63%)
net.html 345.25 KB 346.79 KB +1.55 KB (+0.45%)
perf_hooks.html 360.73 KB 362.24 KB +1.51 KB (+0.42%)
os.js 115.03 KB 116.42 KB +1.40 KB (+1.22%)
webstreams.html 331.76 KB 333.13 KB +1.37 KB (+0.41%)
assert.js 468.33 KB 469.67 KB +1.34 KB (+0.29%)
timers.js 106.96 KB 108.22 KB +1.27 KB (+1.18%)
url.html 330.92 KB 332.18 KB +1.26 KB (+0.38%)
console.js 113.96 KB 115.18 KB +1.22 KB (+1.07%)
module.html 308.74 KB 309.95 KB +1.22 KB (+0.39%)
packages.js 126.04 KB 127.21 KB +1.17 KB (+0.93%)
repl.js 215.42 KB 216.54 KB +1.12 KB (+0.52%)
async_context.js 193.69 KB 194.79 KB +1.10 KB (+0.57%)
events.html 431.62 KB 432.70 KB +1.08 KB (+0.25%)
worker_threads.html 348.86 KB 349.93 KB +1.07 KB (+0.31%)
diagnostics_channel.html 214.61 KB 215.66 KB +1.05 KB (+0.49%)
https.js 165.99 KB 167.03 KB +1.04 KB (+0.62%)
vm.html 327.39 KB 328.42 KB +1.03 KB (+0.31%)
tls.html 347.47 KB 348.48 KB +1.02 KB (+0.29%)
async_hooks.js 201.38 KB 202.38 KB +1.00 KB (+0.50%)
v8.html 299.58 KB 300.53 KB +975.00 B (+0.32%)
single-executable-applications.js 83.03 KB 83.98 KB +971.00 B (+1.14%)
esm.html 153.12 KB 154.07 KB +968.00 B (+0.62%)
tty.js 53.37 KB 54.29 KB +942.00 B (+1.72%)
path.js 105.24 KB 106.08 KB +854.00 B (+0.79%)
inspector.html 163.86 KB 164.69 KB +846.00 B (+0.50%)
domain.js 92.62 KB 93.34 KB +730.00 B (+0.77%)
dns.html 278.79 KB 279.49 KB +715.00 B (+0.25%)
addons.js 300.12 KB 300.81 KB +707.00 B (+0.23%)
sqlite.html 235.62 KB 236.31 KB +702.00 B (+0.29%)
modules.html 176.11 KB 176.76 KB +665.00 B (+0.37%)
assert.html 321.08 KB 321.70 KB +638.00 B (+0.19%)
readline.html 237.22 KB 237.85 KB +637.00 B (+0.26%)
child_process.html 360.64 KB 361.22 KB +598.00 B (+0.16%)
cluster.html 187.94 KB 188.52 KB +595.00 B (+0.31%)
timers.html 122.66 KB 123.22 KB +574.00 B (+0.46%)
async_context.html 157.04 KB 157.56 KB +534.00 B (+0.33%)
dgram.html 181.46 KB 181.96 KB +520.00 B (+0.28%)
repl.html 177.25 KB 177.71 KB +473.00 B (+0.26%)
typescript.js 25.59 KB 26.05 KB +473.00 B (+1.81%)
packages.html 154.20 KB 154.66 KB +464.00 B (+0.29%)
debugger.js 30.81 KB 31.23 KB +430.00 B (+1.36%)
punycode.js 29.93 KB 30.34 KB +427.00 B (+1.39%)
os.html 133.88 KB 134.29 KB +416.00 B (+0.30%)
wasi.js 44.54 KB 44.94 KB +413.00 B (+0.91%)
environment_variables.js 15.00 KB 15.40 KB +404.00 B (+2.63%)
tracing.js 78.86 KB 79.23 KB +385.00 B (+0.48%)
async_hooks.html 155.31 KB 155.67 KB +364.00 B (+0.23%)
report.js 188.55 KB 188.89 KB +353.00 B (+0.18%)
console.html 138.53 KB 138.87 KB +351.00 B (+0.25%)
querystring.js 32.80 KB 33.11 KB +325.00 B (+0.97%)
single-executable-applications.html 105.18 KB 105.49 KB +325.00 B (+0.30%)
intl.js 36.87 KB 37.18 KB +320.00 B (+0.85%)
https.html 143.24 KB 143.53 KB +299.00 B (+0.20%)
permissions.js 28.37 KB 28.62 KB +262.00 B (+0.90%)
tty.html 87.54 KB 87.79 KB +260.00 B (+0.29%)
documentation.js 9.47 KB 9.72 KB +258.00 B (+2.66%)
path.html 131.86 KB 132.09 KB +234.00 B (+0.17%)
string_decoder.js 32.25 KB 32.47 KB +225.00 B (+0.68%)
addons.html 264.92 KB 265.13 KB +221.00 B (+0.08%)
domain.html 101.47 KB 101.67 KB +208.00 B (+0.20%)
embedding.js 37.18 KB 37.34 KB +172.00 B (+0.45%)
environment_variables.html 43.78 KB 43.93 KB +156.00 B (+0.35%)
report.html 175.85 KB 175.99 KB +143.00 B (+0.08%)
tracing.html 82.99 KB 83.13 KB +143.00 B (+0.17%)
typescript.html 54.00 KB 54.14 KB +143.00 B (+0.26%)
debugger.html 53.59 KB 53.72 KB +130.00 B (+0.24%)
permissions.html 56.45 KB 56.58 KB +130.00 B (+0.22%)
synopsis.js 15.67 KB 15.80 KB +129.00 B (+0.80%)
punycode.html 61.17 KB 61.28 KB +117.00 B (+0.19%)
wasi.html 67.29 KB 67.40 KB +117.00 B (+0.17%)
intl.html 59.58 KB 59.69 KB +104.00 B (+0.17%)
querystring.html 60.91 KB 60.99 KB +91.00 B (+0.15%)
documentation.html 37.08 KB 37.16 KB +78.00 B (+0.21%)
styles.css 125.95 KB 125.88 KB -67.00 B (-0.05%)
string_decoder.html 53.45 KB 53.51 KB +65.00 B (+0.12%)
embedding.html 58.53 KB 58.58 KB +52.00 B (+0.09%)
synopsis.html 42.55 KB 42.58 KB +39.00 B (+0.09%)
index.js 9.48 KB 9.51 KB +25.00 B (+0.26%)
index.html 35.19 KB 35.21 KB +16.00 B (+0.04%)

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.

1 participant