Skip to content

fix(docs): repair broken links in app-shell migrations - #219

Merged
anukiransolur merged 1 commit into
mainfrom
fix/migrations-broken-anchors
Aug 25, 2026
Merged

fix(docs): repair broken links in app-shell migrations#219
anukiransolur merged 1 commit into
mainfrom
fix/migrations-broken-anchors

Conversation

@jackchuka

Copy link
Copy Markdown
Member

PR Checks has been failing on main, and therefore on every open dependency PR in this repo (7 of them). Two independent problems, both in docs/app-shell/migrations.md.

lint

The VitePress build failed on two dead links to ../packages/core/CHANGELOG (lines 10 and 161 — hence "2 dead link(s) found"). That path is correct inside the app-shell repo, but docs-sync copies the file here as app-shell/changelog.md, so the original path resolves to nothing.

schema-check

Two anchors were written with GitHub's slugger, which emits a hyphen per separator character, so " / " and " → " produced a doubled hyphen. mdschema collapses runs of hyphens and saw both links as broken.

Why the fix is in the sync script

docs/app-shell is regenerated wholesale by the nightly docs-sync run (rm -rf + re-copy, 00:00 UTC), so fixing the file alone would revert within a day and the deploy would break again. Both rewrites are added to the sync post-processing.

The changelog rewrite is derived from the extraCopies list rather than hardcoding the path, so the copy rule and the link rule cannot drift apart.

Verification

  • pnpm sync:app-shell run against a local app-shell checkout reproduces the committed file exactly — the next nightly sync is a no-op, not a revert.
  • typecheck, docs-sync typecheck, lint, fmt:check, check:links, schema-check and build all pass locally.

Known limitation, deliberately not fixed

A third slug dialect is left alone. VitePress renders ## 1.12.0: ... as id="_1-12-0-...", so the 9 anchors in the migrations table scroll nowhere on the site — that is the pre-existing state, and the build does not check fragments so nothing catches it.

Emitting VitePress's dialect and moving the anchor check out of mdschema was implemented and then reverted: measured across the corpus it was a no-op for all 142 SDK anchors, so ~90 lines of slugger, rewrite and checker were earning their keep on a single file. The reasoning is recorded next to collapseAnchorHyphens for whoever picks it up.

The PR Checks workflow has been failing on main, and so on every open
dependency PR:

- `lint`: the VitePress build failed on two dead links to
  ../packages/core/CHANGELOG. That path is correct inside the app-shell
  repo, but docs-sync copies the file to app-shell/changelog.md, so the
  original path resolves to nothing here.
- `schema-check`: two anchors in docs/app-shell/migrations.md were
  written with GitHub's slugger, which emits a hyphen per separator
  character, so " / " and " -> " produced a doubled hyphen. mdschema
  collapses runs of hyphens and saw both links as broken.

docs/app-shell is regenerated wholesale by the nightly docs-sync run, so
fixing the file alone would revert within a day. Both rewrites are added
to the sync post-processing, and the changelog rewrite is derived from
the `extraCopies` list rather than hardcoding the path, so the copy rule
and the link rule cannot drift apart. Running `pnpm sync:app-shell`
reproduces the committed file exactly.

A third slug dialect is left alone deliberately: VitePress renders
`## 1.12.0: ...` as `id="_1-12-0-..."`, so the 9 anchors in the
migrations table scroll nowhere on the site. The build does not check
fragments, so nothing catches it. Emitting VitePress's dialect and
moving the anchor check out of mdschema was tried and reverted as more
machinery than the problem warrants; the reasoning is recorded next to
collapseAnchorHyphens.
@jackchuka
jackchuka marked this pull request as ready for review August 25, 2026 03:49
@jackchuka
jackchuka requested a review from a team as a code owner August 25, 2026 03:49
@anukiransolur
anukiransolur merged commit 889f25b into main Aug 25, 2026
3 checks passed
@anukiransolur
anukiransolur deleted the fix/migrations-broken-anchors branch August 25, 2026 04:40
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.

2 participants