Repository navigation
Fix Lychee bin entry point so npx/PATH invocations run - #2669
Merged
chalin merged 2 commits intoJun 29, 2026
Merged
Conversation
- Fixes the entry-point guard in the `lychee-norm-cache` and `refcache` bins: `import.meta.url === \`file://${process.argv[1]}\`` never matched for symlinked bins (npm links bins as symlinks), so `npx lychee-norm-cache` silently skipped `main()` and exited 0 — the bins ran only via a direct `node path/to/index.mjs`.
- Compares real paths instead (`realpathSync(argv[1])` vs `fileURLToPath(import.meta.url)`), so the bins work as the `npx` / PATH commands that npm consumers actually invoke.
- Adds a symlink regression test to each bin, skipped on Windows where bin shims are `.cmd` wrappers rather than symlinks.
- Replaces the broken Hugo-module instruction (`go list … github.com/google/docsy`, which resolves to a subtree with no `scripts/`): the bins live outside the theme's Hugo module, so Hugo-module sites add Docsy as a devDependency and run the bins with `npx`. - Documents installing Docsy from GitHub (`github:google/docsy`) until it ships to the npm registry, and corrects the Git-submodule path to `themes/docsy/scripts/…`.
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.
lychee-norm-cacheandrefcachebins:import.meta.url === `file://${process.argv[1]}`never matches for symlinked bins (npm links bins as symlinks), sonpx lychee-norm-cachesilently skippedmain()and exited 0 — the bins ran only via a directnode path/to/index.mjs, which is howdocsy.devand the unit tests invoke them, so it went unnoticed.realpathSync(argv[1])vsfileURLToPath(import.meta.url)), so the bins work as thenpx/ PATH commands npm consumers invoke..cmdwrappers rather than symlinks.scripts/lychee/README.md: the Hugo-module instruction pointed at ago listpath with noscripts/; documents adding Docsy as a devDependency (from GitHub until it ships to npm) and running the bins withnpx, and fixes the Git-submodule path.