docs: fix stale Bun references and add systemic doc drift checks#1024
Conversation
|
64ea954 to
c2da3ab
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c2da3ab. Configure here.
| /** Strip fenced code blocks from markdown content to avoid false positives. */ | ||
| function stripCodeBlocks(content: string): string { | ||
| return content.replace(FENCED_CODE_BLOCK_RE, ""); | ||
| } |
There was a problem hiding this comment.
Duplicated markdown fence stripping
Low Severity
The same fenced-code-block regex and stripCodeBlocks helper were added independently in check-stale-references.ts and check-fragments.ts. Shared logic will diverge if one copy’s behavior changes.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c2da3ab. Configure here.
Fix the Bun→Node migration documentation drift with three systemic improvements: 1. Fix generate-docs-sections.ts root cause - Replace extractBunVersion() with extractPnpmVersion() derived from packageManager - Make both version extractors throw on mismatch instead of silent fallback - Update all prerequisite generators to reference Node.js + pnpm - Remove 'or Bun' from library-usage prerequisite 2. Expand generated marker coverage - Wrap DEVELOPMENT.md prerequisites in GENERATED:START/END dev-prereq markers - Wrap DEVELOPMENT.md build section in GENERATED:START/END build-toolchain markers - Wrap contributing.md build section in GENERATED:START/END build-commands markers - Fix remaining stale refs: library-usage.md, plugins/README.md, check-no-deps.ts 3. Add generic check:stale-refs toolchain consistency check - New script/check-stale-references.ts derives stale patterns from package.json - Reads packageManager field to determine current PM, flags all others - If project migrates from pnpm to yarn, check auto-flags pnpm references - Added to CI lint job 4. Enhance check:fragments with subcommand coverage validation - Check 5: verify fragments mention all subcommands in a route - Handles default commands (sentry local = sentry local serve) - Strips code blocks to avoid false heading matches - Warns by default, --strict flag for hard errors 5. Fill subcommand coverage gaps in fragments - dashboard.md: add revisions, restore examples - cli.md: add defaults, import examples - issue.md: add events subcommand and @latest/@most_frequent selectors Supersedes PR #1022 which found real issues but missed several stale references and lacked systemic prevention.
c2da3ab to
349d3cd
Compare
BYK
left a comment
There was a problem hiding this comment.
Addressing Bugbot feedback:
Default subcommand check too broad — Valid find. Fixed: the bare route check now uses a regex with word boundary (sentry\s+<route>(?:\s*$|[^\w-])) instead of includes(), so sentry issue events no longer falsely satisfies the default command check for sentry issue view.
Duplicated markdown fence stripping — Intentional. These are standalone check scripts with no shared imports (same pattern as check-error-patterns.ts, check-no-deps.ts, etc.). Extracting a shared module for a 3-line regex+function would add a dependency between scripts for minimal benefit. If a third consumer appears, we can revisit.
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 4282 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.95% 81.97% +0.02%
==========================================
Files 329 329 —
Lines 23749 23754 +5
Branches 15502 15504 +2
==========================================
+ Hits 19463 19472 +9
- Misses 4286 4282 -4
- Partials 1643 1641 -2Generated by Codecov Action |


Summary
Fix the Bun→Node migration documentation drift with systemic improvements that prevent this class of error from recurring.
Supersedes #1022 — that PR found real issues but missed several stale references and lacked systemic prevention.
Changes
1. Fix
generate-docs-sections.tsroot causeextractBunVersion()withextractPnpmVersion()derived frompackageManagerfield2. Expand generated marker coverage
Convert hand-written toolchain-dependent prose into generated sections so it can't drift:
DEVELOPMENT.mdprerequisites →GENERATED:START/END dev-prereqmarkersDEVELOPMENT.mdbuild section →GENERATED:START/END build-toolchainmarkerscontributing.mdbuild section →GENERATED:START/END build-commandsmarkersAlso fix remaining stale refs in:
library-usage.md,plugins/README.md,check-no-deps.ts3. Add generic
check:stale-refstoolchain consistency checkNew
script/check-stale-references.tsthat derives stale patterns frompackage.json— not hardcoded to Bun:packageManagerfield to determine the current PM (pnpm)bun run,yarn remove, etc.) in dev-facing docspackageManagerautomatically makes the check flag everypnpm run/pnpm addreference4. Enhance
check:fragmentswith subcommand coverage validationThe existing check only verified fragment files exist — not that they document all subcommands. New Check 5:
sentry local=sentry local serve)--strictflag for hard errors5. Fill subcommand coverage gaps
dashboard.md: addrevisions,restoreexamplescli.md: adddefaults,importexamplesissue.md: addeventssubcommand and@latest/@most_frequentselectorsVerification
All checks pass:
check:fragments— all subcommands coveredcheck:stale-refs— no stale PM references (23 files scanned)check:docs-sections— all generated sections up to datecheck:deps— error message fixedtypecheck— cleantest:unit— 314 files, 7227 tests pass