Skip to content
Merged
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
1 change: 1 addition & 0 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"test/fixtures/*"
],
"ignoreDependencies": [
"@clack/prompts",
"c12",
"confbox",
"consola",
Expand Down
1 change: 1 addition & 0 deletions packages/nuxi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"prepack": "tsdown"
},
"devDependencies": {
"@clack/prompts": "^1.0.0-alpha.6",
"@nuxt/kit": "^4.2.0",
"@nuxt/schema": "^4.2.0",
"@nuxt/test-utils": "^3.20.1",
Expand Down
23 changes: 15 additions & 8 deletions packages/nuxi/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { PackageManagerName } from 'nypm'
import { existsSync } from 'node:fs'
import process from 'node:process'

import * as clack from '@clack/prompts'
import { defineCommand } from 'citty'
import { colors } from 'consola/utils'
import { downloadTemplate, startShell } from 'giget'
Expand Down Expand Up @@ -466,22 +467,28 @@ export default defineCommand({
await runCommand(addModuleCommand, args)
}

logger.log(`\n✨ Nuxt project has been created with the \`${template.name}\` template.\n`)

// Display next steps
logger.log(
`\n✨ Nuxt project has been created with the \`${template.name}\` template. Next steps:`,
)
const relativeTemplateDir = relative(process.cwd(), template.dir) || '.'
const runCmd = selectedPackageManager === 'deno' ? 'task' : 'run'
const nextSteps = [
!ctx.args.shell
&& relativeTemplateDir.length > 1
&& `\`cd ${relativeTemplateDir}\``,
`Start development server with \`${selectedPackageManager} ${runCmd} dev\``,
&& colors.cyan(`cd ${relativeTemplateDir}`),
colors.cyan(`${selectedPackageManager} ${runCmd} dev`),
].filter(Boolean)

for (const step of nextSteps) {
logger.log(` β€Ί ${step}`)
}
clack.box(`\n${nextSteps.map(step => ` β€Ί ${step}`).join('\n')}\n`, ` πŸ‘‰ Next steps `, {
contentAlign: 'left',
titleAlign: 'left',
width: 'auto',
titlePadding: 2,
contentPadding: 2,
rounded: true,
includePrefix: false,
formatBorder: (text: string) => `${themeColor + text}\x1B[0m`,
})

if (ctx.args.shell) {
startShell(template.dir)
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prepack": "tsdown"
},
"dependencies": {
"@clack/prompts": "^1.0.0-alpha.6",
"c12": "^3.3.1",
"citty": "^0.1.6",
"confbox": "^0.2.2",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading