feat(nuxi): use nuxt/starter by default for templates

This commit is contained in:
Pooya Parsa 2022-01-17 22:29:32 +01:00
parent 0af01668c1
commit 21b664cc74

View File

@ -7,32 +7,21 @@ import { defineNuxtCommand } from './index'
const rpath = p => relative(process.cwd(), p) const rpath = p => relative(process.cwd(), p)
const knownTemplates = {
nuxt3: 'nuxt/starter#v3',
v3: 'nuxt/starter#v3',
bridge: 'nuxt/starter#bridge'
}
const resolveTemplate = (template) => { const resolveTemplate = (template) => {
if (!template) {
return knownTemplates.nuxt3
}
if (typeof template === 'boolean') { if (typeof template === 'boolean') {
consola.error('Please specify a template') consola.error('Please specify a template!')
process.exit(1) process.exit(1)
} }
if (template in knownTemplates) { if (!template) {
return knownTemplates[template] template = 'v3'
} }
if (template.includes('/')) { if (template.includes('/')) {
return template return template
} }
consola.error(`Invalid template name: \`${template}\``) return `nuxt/starter#${template}`
process.exit(1)
} }
export default defineNuxtCommand({ export default defineNuxtCommand({