MCPcopy Create free account
hub / github.com/TanStack/cli / getProjectName

Function getProjectName

packages/cli/src/ui-prompts.ts:67–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67export async function getProjectName(): Promise<string> {
68 const value = await text({
69 message: 'Project name (leave empty to use current directory)',
70 // Clack prints `undefined` on blank submit when placeholder is omitted.
71 placeholder: '',
72 validate(value) {
73 const projectName = value ?? ''
74
75 if (isCurrentDirectoryProjectNameInput(projectName)) {
76 return
77 }
78
79 const { valid, error } = validateProjectName(projectName)
80 if (!valid) {
81 return error
82 }
83 },
84 })
85
86 if (isCancel(value)) {
87 cancel('Operation cancelled.')
88 process.exit(0)
89 }
90
91 return (value ?? '').trim()
92}
93
94export async function selectPackageManager(): Promise<PackageManager> {
95 const packageManager = await select({

Callers 2

ui-prompts.test.tsFile · 0.90
promptForCreateOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected