From ce421fc5da8b7c609c2186b096ed2742d7bad39f Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Sat, 6 Jun 2026 23:41:48 -0600 Subject: [PATCH] Fix project name prompt placeholder leak --- packages/cli/src/ui-prompts.ts | 3 +-- packages/cli/tests/ui-prompts.test.ts | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/ui-prompts.ts b/packages/cli/src/ui-prompts.ts index 5cf162c7..a4c6032c 100644 --- a/packages/cli/src/ui-prompts.ts +++ b/packages/cli/src/ui-prompts.ts @@ -66,8 +66,7 @@ export async function selectInstall(): Promise { export async function getProjectName(): Promise { const value = await text({ - message: 'What would you like to name your project?', - placeholder: 'Leave empty to initialize in the current directory', + message: 'Project name (leave empty to use current directory)', validate(value) { if (isCurrentDirectoryProjectNameInput(value)) { return diff --git a/packages/cli/tests/ui-prompts.test.ts b/packages/cli/tests/ui-prompts.test.ts index 2957d844..5e1b9857 100644 --- a/packages/cli/tests/ui-prompts.test.ts +++ b/packages/cli/tests/ui-prompts.test.ts @@ -34,14 +34,16 @@ describe('getProjectName', () => { const projectName = await getProjectName() const textOptions = textSpy.mock.calls[0]![0] as { + message?: string placeholder?: string validate?: (value: string) => string | undefined } expect(projectName).toBe('') - expect(textOptions.placeholder).toBe( - 'Leave empty to initialize in the current directory', + expect(textOptions.message).toBe( + 'Project name (leave empty to use current directory)', ) + expect(textOptions.placeholder).toBeUndefined() expect(textOptions.validate?.('')).toBeUndefined() expect(textOptions.validate?.('.')).toBeUndefined() })