You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This updates metadata slug generation for the deprecations page so headings like
DEP0001: http.OutgoingMessage.prototype.flushuse the shortDEP0001anchor 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 --checknode --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 atERR_MODULE_NOT_FOUND: Cannot find package 'unist-builder'.Related Issues
Fixes #790.
Check List
node --run testand all tests passed.node --run format&node --run lint.