(argOption?: string)
| 127 | } |
| 128 | |
| 129 | async function namePicker(argOption?: string) { |
| 130 | if (argOption) { |
| 131 | return pathToName(argOption) |
| 132 | } |
| 133 | |
| 134 | const defaultName = pathToName(process.cwd()) |
| 135 | |
| 136 | const name = await handleCancel( |
| 137 | text({ |
| 138 | message: picocolors.bold('Name your app'), |
| 139 | placeholder: defaultName, |
| 140 | validate: (value) => { |
| 141 | if (value && !isValidPackageName(value)) { |
| 142 | return `Invalid name: ${value}` |
| 143 | } |
| 144 | |
| 145 | return undefined |
| 146 | }, |
| 147 | }) |
| 148 | ) |
| 149 | |
| 150 | if (!name.trim()) return defaultName |
| 151 | return pathToName(name) |
| 152 | } |
| 153 | |
| 154 | function findAvailableDir(targetDir: string): string { |
| 155 | if (isDirEmpty(targetDir)) { |
no test coverage detected
searching dependent graphs…