mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1037] [MERGED] fix: validate CLI --port / --hostname values, reject missing/flags-as-values #1039
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1039
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1037
Author: @NathanDrake2406
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @james-elicx
Base:
main← Head:fix/cli-arg-parsing📝 Commits (1)
dcbf35efix: validate CLI --port / --hostname values, reject missing/flags-as-values (#1012)📊 Changes
3 files changed (+399 additions, -41 deletions)
View changed files
➕
packages/vinext/src/cli-args.ts(+147 -0)📝
packages/vinext/src/cli.ts(+5 -41)➕
tests/cli-args.test.ts(+247 -0)📄 Description
Fixes #1012
Summary
The vinext CLI argument parser silently consumed missing values for --port / -p and --hostname / -H flags, causing:
This change adds validation that throws clear, actionable errors.
What changed
Behavior parity
Next.js CLI uses similar validation via next/src/cli/next-dev.ts. Error messages follow the standard flag-requires-a-value convention.
Test plan
33 tests covering: missing value at end of args, flag consumed as value, non-numeric port, long/short forms, =value forms, boolean flags, combined flags, edge cases.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.