Skip to content

[Repo Assist] fix: add --root to fsdocs watch; fix WebSocket hot-reload URL#1164

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-924-watch-root-2-802c492af21d1c22
Draft

[Repo Assist] fix: add --root to fsdocs watch; fix WebSocket hot-reload URL#1164
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-924-watch-root-2-802c492af21d1c22

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated pull request from Repo Assist.

Supersedes #1089, which had accumulated many merge commits and could not be cleanly rebased.

Summary

Fixes two issues with fsdocs watch:

  1. WebSocket hot-reload URL was hardcoded to ws://localhost:<port>/websocket, breaking hot reload in GitHub Codespaces, behind reverse proxies, and over HTTPS. Now uses ws://" + window.location.host + "/websocket instead.

  2. Root URL override (--root): fsdocs watch previously forced root = (localhost/redacted) ignoring any user-specified root. Adds a --rootoption toWatchCommand` so users can specify the root URL when serving behind a proxy or from a non-localhost environment.

Usage:

fsdocs watch --root /                          # root-relative URLs
fsdocs watch --root (example.com/redacted)  # absolute remote URL

Changes

  • src/fsdocs-tool/BuildCommand.fs:
    • generateWatchScript: remove port param; use window.location.host for WebSocket URI
    • Add abstract root_override_option to CoreBuildOptions (default None)
    • Watch-mode root: use root_override_option when set, else fall back to localhost
    • WatchCommand: add --root option, override root_override_option
  • RELEASE_NOTES.md: add entries for both fixes

Test Status

  • Build: 0 warnings, 0 errors
  • Tests: 319/319 pass (281 Markdown + 29 ApiDocs + 7 Literate + 1 fsdocs + 1 other)

Closes #924

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@e1ecf341a90b7bc2021e77c58685d7e269e20b99

…et hot-reload

Closes #924

Previously fsdocs watch always forced root = http://localhost:<port>/,
ignoring any user-supplied root parameter. This makes the generated pages
unusable when served via GitHub Codespaces port-forwarding, a reverse proxy,
or any other non-localhost environment.

Changes:
- Add --root option to WatchCommand to override the root URL
- Add abstract root_override_option to CoreBuildOptions (default None)
- Watch-mode root logic: uses --root value when provided, else falls back
  to http://localhost:<port>/ as before
- Fix WebSocket hot-reload URL to use window.location.host instead of
  hardcoded localhost, enabling hot reload across reverse proxies and
  Codespaces

Usage:
  fsdocs watch --root /                          # root-relative URLs
  fsdocs watch --root https://example.com/docs/  # absolute remote URL

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable watch server from arbitrary host

0 participants