Skip to content

Commit dc6fb3f

Browse files
author
Ramu Narasinga
committed
more explanation
1 parent a2a5a47 commit dc6fb3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

create-next-app/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,18 @@ async function run(): Promise<void> {
236236
}
237237

238238
if (!projectPath) {
239+
// Read more about prompts here:
240+
// https://www.npmjs.com/package/prompts
239241
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
240244
onState: onPromptState,
241245
type: 'text',
242246
name: 'path',
243247
message: 'What is your project named?',
244248
initial: 'my-app',
249+
// validates ensures to follow npm package name guidelines
250+
// availabe here: https://www.npmjs.com/package/validate-npm-package-name
245251
validate: (name) => {
246252
const validation = validateNpmName(path.basename(path.resolve(name)))
247253
if (validation.valid) {

0 commit comments

Comments
 (0)