Skip to content

fix: use DEP codes for deprecation metadata slugs#828

Open
Thenightrevenge wants to merge 1 commit into
nodejs:mainfrom
Thenightrevenge:codex/short-deprecation-metadata-slugs
Open

fix: use DEP codes for deprecation metadata slugs#828
Thenightrevenge wants to merge 1 commit into
nodejs:mainfrom
Thenightrevenge:codex/short-deprecation-metadata-slugs

Conversation

@Thenightrevenge
Copy link
Copy Markdown

@Thenightrevenge Thenightrevenge commented Jun 3, 2026

Description

This updates metadata slug generation for the deprecations page so headings like DEP0001: http.OutgoingMessage.prototype.flush use the short DEP0001 anchor instead of the full heading text.

It keeps normal slugging for DEP-style headings outside the deprecations page and adds deterministic suffixes if the same DEP code appears more than once.

Validation

  • git diff --check
  • Added unit coverage for deprecations-page DEP slugs, duplicate DEP slugs, and normal slug behavior outside the deprecations page.
  • Attempted focused Node test: node --test --experimental-test-module-mocks src/generators/metadata/utils/__tests__/parse.test.mjs, but the local sparse clone has no installed npm dependencies and stopped at ERR_MODULE_NOT_FOUND: Cannot find package 'unist-builder'.

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 check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@Thenightrevenge Thenightrevenge requested a review from a team as a code owner June 3, 2026 14:27
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jun 3, 2026 2:28pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 3, 2026

PR Summary

Low Risk
Localized metadata slug logic for one doc path, covered by new unit tests; no auth, runtime API, or broad refactors.

Overview
On the deprecations API doc only, heading metadata slugs now use the DEP#### code from headings like DEP0001: … instead of a slug derived from the full title. Duplicate codes on the same page get suffixed (DEP0001-1, etc.); non-matching headings on that page still use the normal slugger.

Other API pages are unchanged—DEP#### headings there still get the usual slugified anchors (e.g. dep0190-some-section-heading). A shared DEPRECATION_HEADING_REGEX drives the behavior, with unit tests covering all three cases.

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

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

1 participant