Skip to content

[links update] add redirects check#100

Merged
mike-diamond merged 8 commits intomainfrom
links-update
May 5, 2026
Merged

[links update] add redirects check#100
mike-diamond merged 8 commits intomainfrom
links-update

Conversation

@mike-diamond
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: MikeDiam <info@mdiamond.ru>
Copilot AI review requested due to automatic review settings May 4, 2026 13:43
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview May 5, 2026 1:35pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 checkRedirects script plus Husky pre-commit hook, and a GitHub Actions workflow to run the check on PRs that touch content/redirects.
  • Updates redirects.ts entries (including an anchor update) and updates dependencies/lockfile for tsx + 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.

Comment thread scripts/checkRedirects/util/output.ts Outdated
Comment thread .husky/pre-commit
Comment thread .github/workflows/check-redirects.yml
Comment thread scripts/checkRedirects/util/parser.ts
Signed-off-by: MikeDiam <info@mdiamond.ru>
Signed-off-by: MikeDiam <info@mdiamond.ru>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .husky/pre-commit
@tsudmi tsudmi closed this May 4, 2026
@tsudmi tsudmi reopened this May 4, 2026
Signed-off-by: MikeDiam <info@mdiamond.ru>
Copilot AI review requested due to automatic review settings May 5, 2026 05:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .husky/pre-commit
Comment thread scripts/checkRedirects/util/anchors.ts Outdated
Comment thread scripts/checkRedirects/util/anchors.ts
Comment thread scripts/checkRedirects/util/anchors.ts
Comment thread package.json Outdated
Signed-off-by: MikeDiam <info@mdiamond.ru>
Signed-off-by: MikeDiam <info@mdiamond.ru>
Copilot AI review requested due to automatic review settings May 5, 2026 11:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .husky/pre-commit
Comment thread scripts/checkRedirects/util/anchors.ts
Comment thread scripts/checkRedirects/util/anchors.ts
Comment thread scripts/checkRedirects/util/anchors.ts
Comment thread scripts/checkRedirects/util/parser.ts
Comment thread package.json
Comment thread package.json
Comment thread scripts/checkRedirects/util/parser.ts
dfkadyr
dfkadyr previously approved these changes May 5, 2026
Signed-off-by: MikeDiam <info@mdiamond.ru>
Copy link
Copy Markdown
Contributor

@Cast0001 Cast0001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mike-diamond mike-diamond merged commit 1fb9328 into main May 5, 2026
2 checks passed
@mike-diamond mike-diamond deleted the links-update branch May 5, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants