mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore(cli): clean
This commit is contained in:
@@ -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
2
cli/index.mjs
Normal file → Executable 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: {
|
||||
|
||||
Reference in New Issue
Block a user