Skip to content

Commit 349d3cd

Browse files
committed
docs: fix stale Bun references and add systemic doc drift checks
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.
1 parent 1bec084 commit 349d3cd

18 files changed

Lines changed: 761 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ jobs:
197197
- run: pnpm run check:deps
198198
- run: pnpm run check:errors
199199
- run: pnpm run check:patches
200+
- run: pnpm run check:stale-refs
200201

201202
test-unit:
202203
name: Unit Tests

.lore.md

Lines changed: 75 additions & 6 deletions
Large diffs are not rendered by default.

DEVELOPMENT.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## Prerequisites
44

5-
- [Bun](https://bun.sh/) installed
5+
<!-- GENERATED:START dev-prereq -->
6+
- [Node.js](https://nodejs.org/) v22.15+ installed
7+
- [pnpm](https://pnpm.io/) v10.11+ installed
8+
<!-- GENERATED:END dev-prereq -->
69
- A Sentry OAuth application (create one at https://sentry.io/settings/account/api/applications/)
710

811
## Setup
@@ -88,11 +91,13 @@ The table below lists the most common development variables. For the complete re
8891

8992
## Building
9093

91-
Building the native binary still requires Bun:
94+
<!-- GENERATED:START build-toolchain -->
95+
Build the native binary (uses esbuild for bundling and fossilize for Node SEA packaging):
9296

9397
```bash
9498
pnpm run build
9599
```
100+
<!-- GENERATED:END build-toolchain -->
96101

97102
## Architecture
98103

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Credentials are stored in `~/.sentry/` with restricted permissions (mode 600).
7777
## Library Usage
7878

7979
<!-- GENERATED:START library-prereq -->
80-
Use Sentry CLI programmatically in Node.js (≥22.15) or Bun without spawning a subprocess:
80+
Use Sentry CLI programmatically in Node.js (≥22.15) without spawning a subprocess:
8181
<!-- GENERATED:END library-prereq -->
8282

8383
```typescript
@@ -118,7 +118,7 @@ Errors are thrown as `SentryError` with `.exitCode` and `.stderr`.
118118
### Prerequisites
119119

120120
<!-- GENERATED:START dev-prereq -->
121-
- [Bun](https://bun.sh) v1.3+
121+
- [Node.js](https://nodejs.org) v22.15+ and [pnpm](https://pnpm.io) v10.11+
122122
<!-- GENERATED:END dev-prereq -->
123123

124124
### Setup

docs/src/content/docs/contributing.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ We welcome contributions to the Sentry CLI! This guide will help you get started
1010
### Prerequisites
1111

1212
<!-- GENERATED:START dev-prereq -->
13-
- [Bun](https://bun.sh) runtime (v1.3 or later)
13+
- [Node.js](https://nodejs.org) (v22.15 or later)
14+
- [pnpm](https://pnpm.io) (v10.11 or later)
1415
<!-- GENERATED:END dev-prereq -->
1516
- Git
1617

@@ -84,8 +85,9 @@ cli/
8485

8586
## Building
8687

88+
<!-- GENERATED:START build-commands -->
8789
```bash
88-
# Build for current platform (requires Bun for native binary compilation)
90+
# Build for current platform (uses esbuild + fossilize for Node SEA packaging)
8991
pnpm run build
9092

9193
# Build for all platforms
@@ -94,6 +96,7 @@ pnpm run build:all
9496
# Create npm bundle
9597
pnpm run bundle
9698
```
99+
<!-- GENERATED:END build-commands -->
97100

98101
## Testing
99102

docs/src/content/docs/library-usage.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Library Usage
3-
description: Use the Sentry CLI programmatically in Node.js or Bun
3+
description: Use the Sentry CLI programmatically in Node.js
44
---
55

66
The Sentry CLI can be used as a JavaScript/TypeScript library, running commands
@@ -216,7 +216,6 @@ Calls should be sequential (awaited one at a time).
216216
## Requirements
217217

218218
- **Node.js >= 22** (required for `node:sqlite`)
219-
- Or **Bun** (any recent version)
220219

221220
## Streaming Commands
222221

docs/src/fragments/commands/cli.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,52 @@ The CLI detects how it was installed and uses the appropriate upgrade method:
6161

6262
Nightly builds are only available as standalone binaries (via the curl install method). Switching to nightly from a package manager install will automatically migrate to a standalone binary.
6363

64+
### View and manage defaults
65+
66+
```bash
67+
# Show all current defaults
68+
sentry cli defaults
69+
70+
# Set default organization
71+
sentry cli defaults org my-org
72+
73+
# Set default project
74+
sentry cli defaults project my-project
75+
76+
# Set default Sentry URL (self-hosted)
77+
sentry cli defaults url https://sentry.example.com
78+
79+
# Disable telemetry
80+
sentry cli defaults telemetry off
81+
82+
# Clear a single default
83+
sentry cli defaults org --clear
84+
85+
# Clear all defaults
86+
sentry cli defaults --clear
87+
```
88+
89+
### Import legacy settings
90+
91+
Import settings from `.sentryclirc` files used by the legacy `sentry-cli`:
92+
93+
```bash
94+
# Auto-detect and import .sentryclirc
95+
sentry cli import
96+
97+
# Preview what would be imported
98+
sentry cli import --dry-run
99+
100+
# Skip confirmation prompt
101+
sentry cli import --yes
102+
103+
# Explicitly trust a self-hosted URL
104+
sentry cli import --url https://sentry.example.com
105+
106+
# Skip API validation of the imported token
107+
sentry cli import --skip-validation
108+
```
109+
64110
### Send feedback
65111

66112
```bash

docs/src/fragments/commands/dashboard.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,36 @@ sentry dashboard widget delete 'My Dashboard' --title 'Error Count'
108108
sentry dashboard widget delete 12345 --index 2
109109
```
110110

111+
### View revision history
112+
113+
```bash
114+
# List revisions by dashboard title
115+
sentry dashboard revisions 'Frontend Performance'
116+
117+
# List revisions by dashboard ID
118+
sentry dashboard revisions 12345
119+
120+
# With explicit org
121+
sentry dashboard revisions my-org 12345
122+
```
123+
124+
### Restore a previous revision
125+
126+
```bash
127+
# Restore by dashboard title and revision number
128+
sentry dashboard restore 'Frontend Performance' --revision 3
129+
130+
# Restore by dashboard ID
131+
sentry dashboard restore 12345 --revision 1
132+
133+
# With explicit org
134+
sentry dashboard restore my-org 12345 --revision 1
135+
```
136+
137+
:::tip
138+
Use `sentry dashboard revisions` to find the revision number before restoring.
139+
:::
140+
111141
## Query Shorthand
112142

113143
The `--query` flag supports shorthand for aggregate functions:

docs/src/fragments/commands/issue.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,40 @@ Sentry search uses **implicit AND** — space-separated terms are all required.
5353
Full syntax reference: [Sentry Search Docs](https://docs.sentry.io/concepts/search/)
5454
:::
5555

56+
### Magic selectors
57+
58+
Use `@latest` and `@most_frequent` to target issues without knowing their ID:
59+
60+
```bash
61+
# View the most recent issue
62+
sentry issue view @latest
63+
64+
# Explain the most frequently occurring issue
65+
sentry issue explain @most_frequent
66+
67+
# Generate a fix plan for the latest issue
68+
sentry issue plan @latest
69+
```
70+
71+
### List events for an issue
72+
73+
```bash
74+
# List recent events for an issue
75+
sentry issue events FRONT-ABC
76+
77+
# Filter events by search query
78+
sentry issue events FRONT-ABC --query "browser:Chrome"
79+
80+
# Show full event details
81+
sentry issue events FRONT-ABC --full
82+
83+
# Limit results and filter by time period
84+
sentry issue events FRONT-ABC --limit 50 --period 24h
85+
86+
# Paginate through results
87+
sentry issue events FRONT-ABC -c next
88+
```
89+
5690
### View an issue
5791

5892
```bash

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
"check:deps": "pnpm tsx script/check-no-deps.ts",
121121
"check:errors": "pnpm tsx script/check-error-patterns.ts",
122122
"check:patches": "pnpm tsx script/check-patches.ts",
123-
"check:docs-sections": "pnpm tsx script/generate-docs-sections.ts --check"
123+
"check:docs-sections": "pnpm tsx script/generate-docs-sections.ts --check",
124+
"check:stale-refs": "pnpm tsx script/check-stale-references.ts"
124125
},
125126
"type": "module",
126127
"types": "./dist/index.d.cts",

0 commit comments

Comments
 (0)