chore: replace markdown-toc with markdown-toc-gen - #270
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #270 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 263 263
=========================================
Hits 263 263 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
arb
force-pushed
the
replace-markdown-toc-with-markdown-toc-gen
branch
from
May 4, 2026 13:19
8e78c34 to
c6ec392
Compare
`markdown-toc@1.x` is unmaintained and emits three deprecation warnings on `npm install` (`coffee-script`, `gulp-header`, `lodash.template`). Swap to `markdown-toc-gen`, which uses the same `<!-- toc -->` / `<!-- tocstop -->` markers and ships a GFM-spec slug algorithm by default. Dep impact: -48 packages unique to `markdown-toc`, +3 net-new (`markdown-toc-gen`, `jest-get-type`, `diff-sequences`); the rest of its tree is already pulled in by `eslint`/`expect`/etc. The `toc` npm script now invokes the CLI directly. The `version` hook (`npm run toc && git add README.md`) is unchanged. Refs #267 Co-authored-by: Cursor <cursoragent@cursor.com>
The wrapper existed only to pass two options that markdown-toc's CLI couldn't accept: a custom `slugify` callback (to produce GFM-style anchors that matched GitHub's renderer) and `bullets: '-'`. `markdown-toc-gen` makes both defaults, so the wrapper is now pure indirection over the CLI. Refs #267 Co-authored-by: Cursor <cursoragent@cursor.com>
arb
force-pushed
the
replace-markdown-toc-with-markdown-toc-gen
branch
from
May 4, 2026 13:32
c6ec392 to
09e0936
Compare
Run `npm run toc` against the new `markdown-toc-gen` tool to refresh the TOC against the current README headings. Closes #267 Co-authored-by: Cursor <cursoragent@cursor.com>
arb
force-pushed
the
replace-markdown-toc-with-markdown-toc-gen
branch
from
May 4, 2026 13:38
372f39a to
3d122c7
Compare
arb
marked this pull request as ready for review
May 4, 2026 13:39
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #267.
markdown-toc@1.xis unmaintained and emits three deprecation warnings on install (coffee-script,gulp-header,lodash.template). Replace withmarkdown-toc-gen, which uses the same<!-- toc -->markers.Dep impact: -48 packages unique to
markdown-toc, +3 net-new (markdown-toc-gen,jest-get-type,diff-sequences).utils/generate-toc.jsis deleted: it only existed to overridemarkdown-toc's slug algorithm (to match GFM) and force hyphen bullets.markdown-toc-gendefaults to both, so the wrapper became pure indirection.package.jsoninvokes the CLI directly now; theversionhook is unchanged.The regenerated TOC also picks up the existing
## 16.x breaking changesheading, which had been added to the README without anpm run tocrun and was missing from the old TOC.Verified: every previously-existing TOC entry is byte-identical to what the old wrapper produced (slug equivalence confirmed);
npm run tocis idempotent; cleannpm installdrops the three named warnings;npm test(62/62, 100% cov),npx eslint ., and theversionhook all pass.