chore(cli): clean

This commit is contained in:
Benjamin Canac
2024-04-04 11:22:49 +02:00
parent 39cd67a5e3
commit e360ab3084
3 changed files with 4 additions and 4 deletions

View File

@@ -2,8 +2,8 @@ import { existsSync, promises as fsp } from 'node:fs'
import { resolve } from 'pathe'
import { defineCommand } from 'citty'
import { consola } from 'consola'
import { splitByCase, upperFirst, camelCase } from 'scule'
import templates from '../utils/templates.mjs'
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
import templates from '../templates.mjs'
export default defineCommand({
meta: {
@@ -42,7 +42,7 @@ export default defineCommand({
const themePath = resolve(path, 'src/theme/index.ts')
const theme = await fsp.readFile(themePath, 'utf-8')
const themeContents = `export { default as ${camelCase(name)} } from './${camelCase(name)}'`
const themeContents = `export { default as ${camelCase(name)} } from './${kebabCase(name)}'`
if (!theme.includes(themeContents)) {
await fsp.writeFile(themePath, theme.trim() + '\n' + themeContents + '\n')
}

2
cli/index.mjs Normal file → Executable file
View File

@@ -3,7 +3,7 @@ import init from './commands/init.mjs'
const main = defineCommand({
meta: {
name: 'nuxtui',
name: 'nuxt-ui',
description: 'Nuxt UI CLI'
},
subCommands: {