fix(cli): wmill dev --no-browser was a no-op

Cliffy's `.option("--no-browser", ...)` creates an option named
`browser` (boolean, default undefined) that becomes `false` when the
flag is passed. The previous code checked `opts.noBrowser`, which
Cliffy never populates, so the guard silently no-op'd and the browser
always opened. Rename to `browser` and check `=== false` explicitly,
matching the `wmill app dev --no-open` convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-04-23 16:50:22 +02:00
co-authored by Claude Opus 4.7
parent 201c05ebff
commit e40a25df9c
+2 -2
View File
@@ -186,7 +186,7 @@ async function listWorkspacePaths(): Promise<WmPathItem[]> {
export interface DevOpts {
proxyPort?: number;
path?: string;
noBrowser?: boolean;
browser?: boolean;
}
export async function dev(opts: GlobalOptions & SyncOptions & DevOpts) {
@@ -614,7 +614,7 @@ export async function dev(opts: GlobalOptions & SyncOptions & DevOpts) {
}
function maybeOpenBrowser(url: string) {
if (opts.noBrowser) return;
if (opts.browser === false) return;
try {
open.default(url).catch((error) => {
console.error(