[BUG] check-edit-links generates 404s
- Dominant language
- TypeScript
- Stars
- 716
- Forks
- 1.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 35
Description
### Describe the bug.
Running `npm run test:editlinks` generates 404 links for some spec pages.
File: `scripts/markdown/check-edit-links.ts`
### Proposed fixes
Dynamically detect available versions from the filesystem.
- Resolve the specification directory at runtime (`reference/specification/`, derived from `process.cwd()`).
- Read directory contents using Node’s `fs` module.
- Detect specification versions by matching entries against a semantic version pattern:
* `v\d+\.\d+\.\d+` for folders, or
* `v\d+\.\d+\.\d+\.md` for files.
* Normalize file paths (`\` → `/`) before comparisons so behavior is consistent across platforms.
* Pass the discovered version list to `determineEditLink`, allowing it to automatically generate GitHub edit links for any valid spec version without maintaining a manual allowlist.
### Expected behavior
- Files outside the ignore list are checked for broken edit links.
- Files returning 404 are logged with their file paths.
- All other links are considered valid.
### Screenshots
After making the proposed changes, running `npm run test:editlinks` confirms that all edit links are valid
### How to Reproduce
1. `npm install`
2. `npm run test:editlinks`
### 🖥️ Device Information [optional]
- Operating System (OS): Windows
### 👀 Have you checked for similar open issues?
- [x] I checked and didn't find similar issue
### 🏢 Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md)
### Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Contributor guide
Research direction
Start with scripts/markdown/check-edit-links.ts and run npm run test:editlinks to reproduce the 404s. Inspect reference/specification/ and use its available version entries when determining edit links, including normalized paths. Done when the command reports 404s only for genuinely broken links and valid specification links pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100