feat(core): print clickable dev-server URLs and dev-bypass shortcut#1382
feat(core): print clickable dev-server URLs and dev-bypass shortcut#1382ascorbic wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: c9867cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | c9867cd | Jun 08 2026, 09:23 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
emdash-playground | c9867cd | Jun 08 2026, 09:23 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | c9867cd | Jun 08 2026, 09:24 AM |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
PR template validation failedPlease fix the following issues by editing your PR description:
See CONTRIBUTING.md for the full contribution policy. |
There was a problem hiding this comment.
Pull request overview
This PR improves the EmDash Astro integration’s astro dev startup output by moving route/link printing to the point where the dev server is actually listening (so the port is known), and by adding a dev-only bypass link plus the installed EmDash version in the banner.
Changes:
- Print the EmDash version in the startup banner.
- Print absolute (clickable) dev-server URLs for Admin UI and (optionally) MCP once the dev server is listening, and include a dev-bypass shortcut link.
- Add a Changeset documenting the new dev-server output behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/astro/integration/index.ts | Adds version to banner and prints absolute dev URLs (including dev-bypass) from the server listening hook. |
| .changeset/dev-server-clickable-urls.md | Declares a minor release and documents the dev-server clickable URL output changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const address = server.httpServer?.address(); | ||
| if (!address || typeof address === "string") return; | ||
| printDevServerInfo( | ||
| `http://${address.address === "::1" ? "localhost" : address.address}:${address.port}`, | ||
| resolvedConfig.mcp !== false, | ||
| ); |
There was a problem hiding this comment.
This is a sensible developer-experience improvement. Moving route printing to astro:server:setup so the actual bound port is known makes absolute URLs possible, and surfacing the dev-bypass shortcut alongside the version in the startup banner is useful without adding any new runtime surface area.
I found one issue that undermines the PR's stated goal: the URL construction from server.httpServer.address() does not handle IPv6 correctly. When the dev server binds to :: (all-interfaces IPv6) or any specific IPv6 address, the generated string lacks brackets and browsers will not navigate to it (e.g. http://:::4321). This is a real bug for users on IPv6-first systems or using --host.
Otherwise the changes look clean: the VERSION import path follows repo conventions, the mcp !== false check is consistent with route injection, and the astroCommand capture is simple and safe. The changeset is appropriate.
| server.httpServer?.once("listening", () => { | ||
| const address = server.httpServer?.address(); | ||
| if (!address || typeof address === "string") return; |
There was a problem hiding this comment.
[needs fixing] The URL formatting from server.httpServer.address() is broken for IPv6 addresses other than ::1. When the dev server binds to :: (all interfaces) or a specific IPv6 address, the resulting string lacks brackets and is not a valid URL — for example http://:::4321. This defeats the PR's goal of "clickable URLs" on IPv6-enabled systems or when using --host.
Bracket IPv6 addresses and map :: / 0.0.0.0 to localhost, matching Vite's own behavior:
| server.httpServer?.once("listening", () => { | |
| const address = server.httpServer?.address(); | |
| if (!address || typeof address === "string") return; | |
| server.httpServer?.once("listening", () => { | |
| const address = server.httpServer?.address(); | |
| if (!address || typeof address === "string") return; | |
| let host = address.address; | |
| if (host === "::1" || host === "::" || host === "0.0.0.0") { | |
| host = "localhost"; | |
| } else if (address.family === "IPv6") { | |
| host = `[${host}]`; | |
| } | |
| printDevServerInfo( | |
| `http://${host}:${address.port}`, | |
| resolvedConfig.mcp !== false, | |
| ); | |
| }); |
What does this PR do?
Improves the
astro devstartup output for EmDash:/_emdash/api/setup/dev-bypass?redirect=/_emdash/admin) that signs you in as a dev admin without passkey setup/auth. Dev-only -- the underlying endpoint already returns 403 in production.Route printing moved from
astro:config:setupto theastro:server:setuplisteninghook (gated oncommand === "dev") since the port isn't known earlier and the bypass shortcut only applies to dev.Closes #
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
Verified locally:
pnpm typecheckandpnpm lint:jsonboth clean.