Skip to content

fix(metadata): use short deprecation anchors#933

Merged
avivkeller merged 8 commits into
nodejs:mainfrom
vsolano9:codex/issue-790-deprecation-links
Jul 25, 2026
Merged

fix(metadata): use short deprecation anchors#933
avivkeller merged 8 commits into
nodejs:mainfrom
vsolano9:codex/issue-790-deprecation-links

Conversation

@vsolano9

Copy link
Copy Markdown
Contributor

Description

Use short DEP#### codes as metadata slugs for headings on the deprecations page. This keeps duplicate handling in the existing stateful slugger, preserves ordinary slugging outside deprecations, and avoids emitting a duplicate legacy HTML alias when the primary slug is already short.

This changes web and Orama links from long heading-derived fragments to stable links such as #DEP0001. Legacy JSON and llms.txt outputs are byte-identical to the base for the tested deprecations source.

Assisted-by: OpenAI Codex

Validation

  • Node.js v24.14.0
  • npm ci (0 vulnerabilities)
  • focused metadata parser test: 27 passed
  • node --run test:ci: 512 passed, 0 failed
  • node --run lint: 0 errors, 2 pre-existing warnings in useOrama.mjs
  • node --run format:check
  • changeset status --since=main
  • node --run test:e2e: 4 passed
  • generated Node.js deprecations source at e6e6f677b34ba0fc87e897512feee11e4d2c0ca4 with legacy-html, legacy-json, web, orama-db, and llms-txt; short anchors were verified in legacy HTML, web, and Orama, with legacy JSON and llms.txt unchanged from base

Related Issues

Fixes #790

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have checked code formatting with node --run format:check and node --run lint.
  • I have covered the new functionality with unit tests.

@vsolano9
vsolano9 requested a review from a team as a code owner July 22, 2026 12:19
@vercel

vercel Bot commented Jul 22, 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 Ready Ready Preview Jul 25, 2026 9:42pm

Request Review

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@vsolano9 is attempting to deploy a commit to the OpenJS Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes shared heading slug generation used across web and search outputs; behavior is scoped to DEP####: headings with tests, but link URLs for deprecations will change from long fragments to short codes.

Overview
Deprecation headings matching DEP####: now get DEP#### as their metadata slug instead of a long heading-derived fragment, so web, Orama, and TOC links use stable anchors like #DEP0001.

DEPRECATION_HEADING_REGEX moves to shared metadata constants; parseApiDoc applies the short code via getHeadingSlug. Legacy HTML still emits a separate legacy alias only when it differs from the primary slug, avoiding duplicate id="DEP0001" when both match.

Unit tests cover metadata slugs and legacy HTML anchor output.

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

Comment thread src/generators/legacy-html/utils/buildContent.mjs
Comment thread src/generators/metadata/utils/parse.mjs Outdated
Comment thread src/generators/metadata/utils/parse.mjs Outdated
Add regression coverage for matching primary and legacy anchors.

Assisted-by: OpenAI Codex
Signed-off-by: Victor Solano <victor.solanonunez@gmail.com>
Comment thread .changeset/short-deprecation-links.md
Comment thread src/generators/metadata/constants.mjs
Share the deprecation heading matcher and classify the published fragment change as minor.

Assisted-by: OpenAI Codex
Signed-off-by: Victor Solano <victor.solanonunez@gmail.com>
Signed-off-by: Victor Solano <victor.solanonunez@gmail.com>
Comment thread src/generators/metadata/utils/parse.mjs Outdated
Comment thread .changeset/short-deprecation-links.md Outdated

@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 f6e9eb6. Configure here.

Comment thread src/generators/metadata/utils/parse.mjs
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79518% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.19%. Comparing base (6a217f0) to head (376720a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../legacy-html/utils/__tests__/buildContent.test.mjs 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #933      +/-   ##
==========================================
+ Coverage   84.89%   86.19%   +1.29%     
==========================================
  Files         193      195       +2     
  Lines       17512    17657     +145     
  Branches     1551     1605      +54     
==========================================
+ Hits        14867    15219     +352     
+ Misses       2639     2432     -207     
  Partials        6        6              

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

Comment thread src/generators/metadata/utils/__tests__/parse.test.mjs Outdated
@avivkeller
avivkeller enabled auto-merge (squash) July 25, 2026 21:42
@avivkeller
avivkeller merged commit b73b704 into nodejs:main Jul 25, 2026
24 of 25 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 25, 2026
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.

Long and short deprecation links

3 participants