Repository navigation
Add packaged, root-level Lychee link-check tooling - #2667
Merged
chalin merged 6 commits intoJun 29, 2026
Merged
Conversation
chalin
force-pushed
the
chalin-m24-lychee-cache-stats-2026-0626
branch
from
June 27, 2026 01:12
b432845 to
80e44d8
Compare
chalin
force-pushed
the
chalin-m24-lychee-cache-stats-2026-0626
branch
from
June 27, 2026 13:35
80e44d8 to
27a707e
Compare
chalin
force-pushed
the
chalin-m24-lychee-cache-stats-2026-0626
branch
from
June 27, 2026 14:30
27a707e to
9cfb67a
Compare
Move the Lychee helpers out of the private docsy.dev site into root-level `scripts/lychee/`, so they ship with the published `docsy` package and any Docsy-based site can run cached Lychee link checking. - `scripts/lychee/check/`: the link-check wrapper (was `docsy.dev/scripts/check-links-lychee.sh`), rewritten as a tested `.mjs`. It resolves a GitHub token, runs Lychee over the built site, and normalizes the cache. Exposed as the `lychee-norm-cache` bin, with `--help`. - `scripts/lychee/refcache/`: the refcache list/prune/summary multi-tool, exposed as the `refcache` bin. - `scripts/lychee/README.md`: usage for both tools, shipped in `files`. - Add the new scripts to root `package.json` `files`/`bin`, and extend `npm-pack.test.mjs` to keep the packaged surface in sync. - Cover the bins in the new-site smoke test via `npx <bin> --help`. - Wire docsy.dev to call the root scripts. `fix:refcache` runs `check:links`, which adds any missing entries to the cache and renormalizes it. - Expose `fix:refcache` and `refcache` from the repo root too, delegating to docsy.dev, so the cache can be refreshed and inspected from either place.
- Removes `check:links:ccr` and `precheck:links:ccr`: the run-command duplicated `check:links`, and the shared-chrome build they triggered is already reachable through the generic `ccr` runner. - Use `npm run ccr check:links` instead — it sets `HUGO_PARAMS_TD_CHROME=shared`, which the inherited `precheck:links` build picks up to produce the same shared-chrome site.
chalin
force-pushed
the
chalin-m24-lychee-cache-stats-2026-0626
branch
from
June 29, 2026 13:43
9cfb67a to
7c489b6
Compare
Prettier 3.9.0–3.9.2 silently corrupt multi-line Hugo shortcodes — a standalone
`%}}` line is rewritten to `}` — breaking `{{% blocks/cover … %}}` content. The
regression (prettier/prettier#19488) was fixed in 3.9.3, so raise the
devDependency floor past the broken range rather than just allowing it.
There's no committed lockfile and CI runs `npm install` (not `npm ci`), so the
`package.json` range is the only guard against resolving a broken 3.9.x.
chalin
force-pushed
the
chalin-m24-lychee-cache-stats-2026-0626
branch
from
June 29, 2026 14:13
7c489b6 to
cedbae4
Compare
- maintainer-notes.md: add a "Link checking and the refcache" section documenting the lychee check, the committed .lycheecache, and the fix:refcache / refcache scripts. - lychee.toml: fix a stale run-command in the header comment (check:links:lychee -> check:links). - Replace private-notes pointers in the lychee config and test headers with a neutral, traceable reference (no private repo name). - test.yaml: run the offline lychee sanity tests in CI (Linux-only, like ci:test), so --index-files / fragment regressions are caught without a full site build.
- refcache/index.mjs: drop the usage/flags block from the file header; it duplicated the USAGE string printed by --help. Keep only the non-obvious bits (read-only/no-network, the refcache line format). - check/index.mjs: same — trim the header's usage line and the parts that restated USAGE, keeping the reuse and gh-token rationale; tighten two helper comments. - README: collapse the usage examples to one per tool and point readers to `--help` (and `lychee --help` for forwarded flags) for the full options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the htmltest→Lychee switch (#2665) to make cached Lychee link-checking consumable by any Docsy-based site, not just docsy.dev. The helpers move out of the private
docsy.dev/site to root-levelscripts/lychee/, so they ship with the publisheddocsypackage (alongsidegen-favicons) and are exposed as bins.Tooling (
scripts/lychee/)check/(binlychee-norm-cache) — the link-check wrapper, converted fromdocsy.dev/scripts/check-links-lychee.shto a tested.mjs. It resolves a GitHub token (GITHUB_TOKENorgh auth token), runs Lychee over the built site, and normalizes the.lycheecache(LC_ALL=C-equivalent byte sort) even on failure. It operates on the current working directory, so any consuming site can call it.-h/--helpprints usage.refcache/(binrefcache) — a small multi-tool over the committed.lycheecache:-l/--list NUMlists the NUM oldest entries;-p/--prune NUM[%]drops the NUM (or NUM%) oldest and rewrites the file;-s/--summaryprints counts, status breakdown, oldest/newest timestamp (local time) and age, and an adaptive age histogram that scales to the cache's own age span.-l 5 -p 5lists the 5 about to be pruned while-p 5 -l 5looks ahead at the next 5. Flags may not repeat; with no options it prints the summary.-h/--helpprints usage.README.md— what/why, requirements, and usage; shipped infiles.Both pure helpers (token resolution, cache sort, refcache parse/select/arg-parsing/ordered-execution) are unit-tested under
scripts/lychee/**/*.test.mjs, now run by roottest:toolingon Linux + Windows. Thefiles/binpackaging surface is locked down bynpm-pack.test.mjs, and the new-site smoke test exercisesnpx <bin> --helpfor each shipped bin.Wiring
fix:refcache(docsy.dev) — runscheck:links, which adds any missing entries to the.lycheecacheand renormalizes it. (Afix:*-family alias for the cache-refresh side effect of a normal check.)fix:refcacheandrefcacheare also exposed from the repo root, delegating to docsy.dev, so the cache can be refreshed (npm run fix:refcache) and inspected (npm run refcache -- -s) from either place.--tocheck:linksso flags forwarded through the nestednpm runreach lychee instead of being swallowed as npm config.check:links:ccr/precheck:links:ccrpair; the shared-chrome variant is already reachable vianpm run ccr check:links.test:lychee) now run on Linux, catching--index-files/ fragment regressions without a full site build.maintainer-notes.mdgains a short "Link checking and the refcache" section.Usage:
Prettier floor (independent of Lychee)
Unrelated to the Lychee work, but bundled here: raises the
prettierdevDependency to^3.9.3. Prettier 3.9.0–3.9.2 silently corrupt multi-line Hugo shortcodes (a standalone%}}line is rewritten to}); the regression (prettier/prettier#19488) was fixed in 3.9.3. With no committed lockfile and CI runningnpm install, thepackage.jsonrange is the only guard against resolving a broken 3.9.x, so the floor is set past the broken range.