Skip to content

Commit 9b097c9

Browse files
Fix project name prompt placeholder leak (#466)
1 parent 6880123 commit 9b097c9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/cli/src/ui-prompts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ export async function selectInstall(): Promise<boolean> {
6666

6767
export async function getProjectName(): Promise<string> {
6868
const value = await text({
69-
message: 'What would you like to name your project?',
70-
placeholder: 'Leave empty to initialize in the current directory',
69+
message: 'Project name (leave empty to use current directory)',
7170
validate(value) {
7271
if (isCurrentDirectoryProjectNameInput(value)) {
7372
return

packages/cli/tests/ui-prompts.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ describe('getProjectName', () => {
3434

3535
const projectName = await getProjectName()
3636
const textOptions = textSpy.mock.calls[0]![0] as {
37+
message?: string
3738
placeholder?: string
3839
validate?: (value: string) => string | undefined
3940
}
4041

4142
expect(projectName).toBe('')
42-
expect(textOptions.placeholder).toBe(
43-
'Leave empty to initialize in the current directory',
43+
expect(textOptions.message).toBe(
44+
'Project name (leave empty to use current directory)',
4445
)
46+
expect(textOptions.placeholder).toBeUndefined()
4547
expect(textOptions.validate?.('')).toBeUndefined()
4648
expect(textOptions.validate?.('.')).toBeUndefined()
4749
})

0 commit comments

Comments
 (0)