[links update] add redirects check#100
Conversation
Signed-off-by: MikeDiam <info@mdiamond.ru>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds an automated redirects check to help keep redirects.ts up to date when content files are renamed/deleted, and validates that redirect targets with #anchors resolve to real headings in the docs.
Changes:
- Introduces
scripts/checkRedirects(diff parsing, redirects parsing, anchor validation, and console output helpers). - Adds
checkRedirectsscript plus Husky pre-commit hook, and a GitHub Actions workflow to run the check on PRs that touch content/redirects. - Updates
redirects.tsentries (including an anchor update) and updates dependencies/lockfile fortsx+husky.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
yarn.lock |
Adds lock entries for new tooling deps (tsx, husky, and transitive deps like esbuild). |
scripts/checkRedirects/index.ts |
Main CLI that reads diff + redirects, checks duplicates/anchors, and reports missing redirects. |
scripts/checkRedirects/util/parser.ts |
Reads redirects.ts from git and parses from: entries + duplicate detection. |
scripts/checkRedirects/util/output.ts |
Formats error output for missing redirects and broken anchors. |
scripts/checkRedirects/util/anchors.ts |
Validates that redirect to fragments point at real heading slugs in target markdown. |
scripts/checkRedirects/util/diff.ts |
Reads/parses git diff --name-status (staged or stdin) and filters relevant files. |
scripts/checkRedirects/util/contentRoots.ts |
Maps repo paths ↔ site URLs and resolves a URL path back to a markdown file candidate. |
scripts/checkRedirects/util/colors.ts |
Small TTY-aware ANSI color helpers for stderr output. |
scripts/checkRedirects/util/index.ts |
Barrel export for checkRedirects utilities. |
redirects.ts |
Updates meta-vault anchor target and adds a couple new redirects. |
package.json |
Adds checkRedirects script, installs tsx and husky, and adds prepare for Husky. |
.husky/pre-commit |
Runs yarn checkRedirects on commit. |
.github/workflows/check-redirects.yml |
Adds CI job that diffs against base ref and runs checkRedirects via stdin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: MikeDiam <info@mdiamond.ru>
Signed-off-by: MikeDiam <info@mdiamond.ru>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: MikeDiam <info@mdiamond.ru>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: MikeDiam <info@mdiamond.ru>
Signed-off-by: MikeDiam <info@mdiamond.ru>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: MikeDiam <info@mdiamond.ru>
No description provided.