GeezerVison is showing github.com — Add deterministic dev port runner for multi-instance local workflows by juliusmarminge · Pull Request #20 · pingdotgg/t3code
Add deterministic dev port runner for multi-instance local workflows
#20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
Add dev runner for deterministic multi-instance port offsets
- Route `dev*` scripts through `scripts/dev-runner.mjs` to compute shared server/web port offsets
- Support `T3CODE_DEV_INSTANCE` (hashed or numeric) and explicit `T3CODE_PORT_OFFSET`
- Document multi-instance usage and allow server `VITE_DEV_SERVER_URL` override
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
The reason will be displayed to describe this comment to others. Learn more.
numeric T3CODE_DEV_INSTANCE values aren't validated before use - large numbers like "70000" will pass through but fail port validation later with a confusing error
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Potential issue | 🟡 Minor
Align usage message with actual invocation.
The scripts call this via bun run, so the error text is slightly misleading.
✏️ Suggested tweak
- throw new Error(`Usage: bun scripts/dev-runner.mjs <mode>. Supported modes: ${supportedModes}`);+ throw new Error(`Usage: bun run scripts/dev-runner.mjs <mode>. Supported modes: ${supportedModes}`);
📝 Committable suggestion
‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
thrownewError(`Usage: bun run scripts/dev-runner.mjs <mode>. Supported modes: ${supportedModes}`);
}
🤖 Prompt for AI Agents
In `@scripts/dev-runner.mjs` around lines 61 - 67, The usage string thrown in
main() is misleading because the script is invoked via "bun run"; update the
thrown Error message inside the mode validation (the block that checks mode and
MODE_ARGS) to reflect the actual invocation (e.g., include "bun run" and mention
optional flags like --dry-run) so the message matches how users run this script;
locate the error creation in function main() where MODE_ARGS is referenced and
replace the existing Usage text with the corrected invocation text.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
All reactions
const { offset, source } = resolveOffset();
const serverPort = BASE_SERVER_PORT + offset;
const webPort = BASE_WEB_PORT + offset;
if (serverPort > 65535 || webPort > 65535) {
throw new Error(
`Port offset too large (${offset}). Computed ports: server=${serverPort}, web=${webPort}`,
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.