Repository navigation
table: web dev servers show their URL, clickable in a terminal, without a request sent - #30
Merged
Merged
Conversation
…ut a request sent
…ly where the terminal renders them
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.
Closes #23, with a changed design (below). Follow-up for what it leaves out: #29.
The most useful fact about a dev server is where to open it. The table now shows it:
NO_COLOR. On Windows, links appear only in Windows Terminal or a terminal that setsTERM_PROGRAM(like VS Code's), because the legacy console prints the escape codes raw.--jsongainsurl. It's additive and omitted when empty.The design change: no request is ever sent
#23 asked to probe every listener with an HTTP request. I didn't, because the listing has to stay side-effect free:
--watchwould repeat all of that every second.Instead the URL comes from framework detection. There's a curated list of dev servers that serve plain HTTP unless told otherwise: Next.js, Vite, Astro, Remix, Nuxt, SvelteKit, Storybook, Angular, NestJS, FastAPI, Django, Flask, Rails, Laravel, Phoenix, Spring Boot, Gin and their kin.
ports doctorstill sends a real request, andports open(open: open a running server in the browser #24) will too.python -m http.server, Bun, Axum…) get no URL yet. table: URLs for HTTP servers outside the framework list #29 weighs an opt-in probe for them.One URL per app, on its own port
A framework label belongs to the process, and one process can hold several ports, so:
--port/-pon the command line names the app port, and only that port gets the URL. A process that names a port it doesn't hold gets none. Next.js runs as two processes: thenext dev -p 3458parent holds only its debugger port, and its server child holds the app port.--inspect9229–9230, JDWP 5005, debugpy 5678 and LiveReload 35729.http://URL. That covers--ssl,--ssl-keyfile,--cert,--certfile,--experimental-httpsand similar. HTTPS set in a config file can't be seen; the docs say so.How it was verified
Gate, locally with CI's versions: unit ✓, build ✓, Windows build ✓, integration ✓ (uncached), installers ✓, gofmt ✓, vet ✓, lint ✓ (v2.13.2). Site:
npm run lint✓,npm run build✓.Live, against a real
next dev(the site inweb/) plus apython -m http.server:--json:"url"appears on the Next.js row only.NO_COLOR: plain text.curlof the URL returns 200.NODE_OPTIONS=--inspect next dev -p 3458: only 3458 has a URL. The parent's inspector (9239) and the child's (9240) have none. My first version gave the parent's inspector a URL, and this live run is what caught it.New tests:
TestLocalURL: binds, IPv6 including zone ids, nginx not guessed, Windows rows, dropped frameworks.TestTableURLColumn: the column only when present, last, no trailing spaces, links only when enabled.TestFillURLs: the inspector,-p/--port, the parent/child Next.js case, JDWP, HTTPS flags, two apps.Every README, docs and
--helptable containing a web server was re-rendered exactly as the binary prints it. The commands page documents the URL column and theurlfield. The landing page's styled tables are left for the Phase 4 site refresh.Risk
Tier: risky (
internal/inspect/output.go,--json).Public surface: a new table column, and a new
urlJSON field (additive).Rollback: revert the squash commit.
A fresh-context review blocked the first commit. On the Windows legacy console, the default
portswould print raw escape codes. That's fixed, and so are its should-fixes:echo/chimatches and multi-process Wrangler were on the list;Notes for the release
The table shows
http://localhost:<port>for known web dev servers (Next.js, Vite, FastAPI, Rails…), clickable in a terminal.--jsonrows gainurl.Generated by Claude Code