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 script checks all documentation pages for broken internal links (404s).
4
+
5
+
## Usage
6
+
7
+
```bash
8
+
# Basic usage (with deduplication - recommended)
9
+
bun ./scripts/lint-404s/main.ts
10
+
11
+
# Show progress for each page
12
+
bun ./scripts/lint-404s/main.ts --progress
13
+
14
+
# Skip deduplication and check all pages (for debugging)
15
+
bun ./scripts/lint-404s/main.ts --skip-deduplication
16
+
17
+
# Filter to a specific path
18
+
bun ./scripts/lint-404s/main.ts --path platforms/javascript
19
+
```
20
+
21
+
## Deduplication
22
+
23
+
By default, the checker **deduplicates common files** to improve performance.
24
+
25
+
### Why?
26
+
27
+
The Sentry docs use a "common" file system where documentation is shared across multiple platforms. For example:
28
+
29
+
-`/platforms/apple/common/configuration/index.mdx` is rendered as:
30
+
-`/platforms/apple/guides/ios/configuration/`
31
+
-`/platforms/apple/guides/macos/configuration/`
32
+
-`/platforms/apple/guides/watchos/configuration/`
33
+
- ... and many more
34
+
35
+
Without deduplication, the checker would fetch and test the same content dozens of times, which:
36
+
37
+
- Takes much longer to run
38
+
- Wastes CI resources
39
+
- Provides no additional value (the content is identical)
40
+
41
+
### How it works
42
+
43
+
1. The checker fetches a source map from `/api/source-map` that maps each slug to its source file
44
+
2. It tracks which source files have been checked
45
+
3. For common files, it only checks the first instance
46
+
4.**API-generated pages** are always checked (they have no source file)
47
+
48
+
This typically reduces the number of pages checked from **~9,000 to ~2,500**, a **72% reduction**.
49
+
50
+
### When to use `--skip-deduplication`
51
+
52
+
Use this flag to skip deduplication and verify that all rendered pages work correctly, even if they share the same source. This is rarely necessary but can help debug issues with:
53
+
54
+
- Path routing
55
+
- Platform-specific rendering bugs
56
+
- Edge cases in the build system
57
+
58
+
## Ignore List
59
+
60
+
The `ignore-list.txt` file contains paths that should be skipped during checking. Add paths here (one per line) if they're known to be inaccessible or are special cases.
0 commit comments