Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@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.
"c8": "^10.1.3",
"eslint": "^9.39.2",
"eslint-import-resolver-node": "^0.3.9",
Expand Down
2 changes: 1 addition & 1 deletion src/generators/jsx-ast/utils/buildBarProps.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const extractHeading = entry => {
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 },
};
};

Expand Down
12 changes: 9 additions & 3 deletions src/generators/jsx-ast/utils/buildContent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,15 @@ export const createHeadingElement = (content, changeElement) => {

// Build heading with anchor link
const headingWrapper = createElement('div', [
createElement(`h${depth}`, [
createElement(`a#${slug}`, { href: `#${slug}` }, headingContent),
]),
createElement(
`h${depth}`,
{ id: slug },
createElement(
'a',
{ href: `#${slug}`, className: ['anchor'] },
headingContent
)
),
Comment on lines +126 to +134
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.
]);

// Prepend type icon if not 'misc' and type exists
Expand Down
1 change: 0 additions & 1 deletion src/generators/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { SemVer } from 'semver';
import type { ApiDocReleaseEntry } from '../types';
import type { publicGenerators, allGenerators } from './index.mjs';

declare global {
Expand Down
51 changes: 36 additions & 15 deletions src/generators/web/ui/components/MetaBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ const iconMap = {

const STABILITY_KINDS = ['error', 'warning', null, 'info'];
const STABILITY_LABELS = ['D', 'E', null, 'L'];
const STABILITY_TOOLTIPS = ['Deprecated', 'Experimental', null, 'Legacy'];

/**
* Renders a heading value with an optional stability badge
* @param {{ value: string, stability: number }} props
*/
const HeadingValue = ({ value, stability }) => {
if (stability === 2) {
return value;
}

const ariaLabel = STABILITY_TOOLTIPS[stability]
? `Stability: ${STABILITY_TOOLTIPS[stability]}`
: undefined;

return (
<>
{value}

<Badge
size="small"
className={styles.badge}
kind={STABILITY_KINDS[stability]}
data-tooltip={STABILITY_TOOLTIPS[stability]}
aria-label={ariaLabel}
tabIndex={0}
>
{STABILITY_LABELS[stability]}
</Badge>
</>
);
};

/**
* MetaBar component that displays table of contents and page metadata
Expand All @@ -38,21 +70,7 @@ export default ({
headings={{
items: headings.map(({ value, stability, ...heading }) => ({
...heading,
value:
stability !== 2 ? (
<>
{value}
<Badge
size="small"
className={styles.badge}
kind={STABILITY_KINDS[stability]}
>
{STABILITY_LABELS[stability]}
</Badge>
</>
) : (
value
),
value: <HeadingValue value={value} stability={stability} />,
})),
}}
items={{
Expand All @@ -62,10 +80,12 @@ export default ({
<ol>
{viewAs.map(([title, path]) => {
const Icon = iconMap[title];

return (
<li key={title}>
<a href={path}>
{Icon && <Icon className={styles.icon} />}

{title}
</a>
</li>
Expand All @@ -76,6 +96,7 @@ export default ({
Contribute: (
<>
<GitHubIcon className="fill-neutral-700 dark:fill-neutral-100" />

<a href={editThisPage}>Edit this page</a>
</>
),
Expand Down
8 changes: 8 additions & 0 deletions src/generators/web/utils/bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export default async function bundleCode(codeMap, { server = false } = {}) {
chunkImportMap: !server,
},

checks: {
// Disable plugin timing logs for cleaner output. This can be re-enabled for debugging performance issues.
pluginTimings: false,
},

// Output configuration
output: {
// Output module format:
Expand Down Expand Up @@ -79,6 +84,9 @@ export default async function bundleCode(codeMap, { server = false } = {}) {

// Module resolution configuration.
resolve: {
// exports condition to use
conditionNames: ['rolldown'],

// Alias react imports to preact/compat for smaller bundle sizes.
// Explicit jsx-runtime aliases are required for the automatic JSX transform.
alias: {
Expand Down
Loading