Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/cli/src/ui-prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export async function selectInstall(): Promise<boolean> {

export async function getProjectName(): Promise<string> {
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
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/tests/ui-prompts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
Loading