Auto-select next available dev ports by mode and remove favicon fallback#140
Merged
juliusmarminge merged 2 commits intomainfrom Mar 2, 2026
Merged
Auto-select next available dev ports by mode and remove favicon fallback#140juliusmarminge merged 2 commits intomainfrom
juliusmarminge merged 2 commits intomainfrom
Conversation
- Probe localhost ports and increment offsets when base ports are taken - Resolve server/web offsets by mode while honoring explicit port/dev-url overrides - Add tests for offset selection and per-mode fallback behavior
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- Stop `findFirstAvailableOffset` only when a required port exceeds `MAX_PORT` - Add test covering offsets where only non-required ports are out of range
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.
Summary
scripts/dev-runner.mjssodev,dev:web, anddev:servereach pick the next available offset based on required portsfindFirstAvailableOffsetandresolveModePortOffsetsinscripts/dev-runner.test.ts/api/project-faviconnow returns404when no icon is found, and remove the related fallback testTesting
scripts/dev-runner.test.ts: validates offset scanning, mode-specific offset behavior, and explicit override handlingapps/server/src/projectFaviconRoute.test.ts: fallback favicon test removed to match new404behaviorbun lint: Not runbun typecheck: Not runNote
Medium Risk
Changes dev startup behavior by introducing async port probing and mode-specific offset selection, which could alter how local environments pick/bind ports (especially across IPv4/IPv6). Test coverage is added, but failures could still surface on unusual network/loopback configurations.
Overview
The dev runner now auto-selects the next available port offset by probing loopback availability and applying mode-specific requirements:
devfinds a shared offset for server+web,dev:webshifts only the web port, anddev:servershifts only the server port (unless explicitT3CODE_PORT/VITE_DEV_SERVER_URLoverrides are provided).It also sets
PORT/ELECTRON_RENDERER_PORT/VITE_DEV_SERVER_URLwhen missing, validates computed ports are within1..65535, improves startup logging to show selected offsets, and switches the entrypoint to async error handling. New unit tests cover offset scanning and override/mode behaviors.Written by Cursor Bugbot for commit 70248fa. This will update automatically on new commits. Configure here.
Note
Auto-select next available dev ports by mode and validate against 1–65535 in
scripts/dev-runner.mjsAdd async port probing on IPv4/IPv6, scan offsets to pick mode-aware server/web ports, and set
PORT,ELECTRON_RENDERER_PORT, andVITE_DEV_SERVER_URLwhen not provided in dev-runner.mjs.📍Where to Start
Start with
resolveModePortOffsetsandrunDevRunnerin dev-runner.mjs.Macroscope summarized 70248fa.