File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -236,12 +236,18 @@ async function run(): Promise<void> {
236
236
}
237
237
238
238
if ( ! projectPath ) {
239
+ // Read more about prompts here:
240
+ // https://www.npmjs.com/package/prompts
239
241
const res = await prompts ( {
242
+ // onPromptState is a function available at
243
+ // https://github.com/vercel/next.js/blob/canary/packages/create-next-app/index.ts#L25
240
244
onState : onPromptState ,
241
245
type : 'text' ,
242
246
name : 'path' ,
243
247
message : 'What is your project named?' ,
244
248
initial : 'my-app' ,
249
+ // validates ensures to follow npm package name guidelines
250
+ // availabe here: https://www.npmjs.com/package/validate-npm-package-name
245
251
validate : ( name ) => {
246
252
const validation = validateNpmName ( path . basename ( path . resolve ( name ) ) )
247
253
if ( validation . valid ) {
You can’t perform that action at this time.
0 commit comments