From e360ab3084a21f9ecf8dea9a447a92bcadd57259 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Thu, 4 Apr 2024 11:22:49 +0200 Subject: [PATCH] chore(cli): clean --- cli/commands/init.mjs | 6 +++--- cli/index.mjs | 2 +- cli/{utils => }/templates.mjs | 0 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 cli/index.mjs rename cli/{utils => }/templates.mjs (100%) diff --git a/cli/commands/init.mjs b/cli/commands/init.mjs index faab603c..a9c18d8a 100644 --- a/cli/commands/init.mjs +++ b/cli/commands/init.mjs @@ -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') } diff --git a/cli/index.mjs b/cli/index.mjs old mode 100644 new mode 100755 index a816fbe8..1c9912a1 --- a/cli/index.mjs +++ b/cli/index.mjs @@ -3,7 +3,7 @@ import init from './commands/init.mjs' const main = defineCommand({ meta: { - name: 'nuxtui', + name: 'nuxt-ui', description: 'Nuxt UI CLI' }, subCommands: { diff --git a/cli/utils/templates.mjs b/cli/templates.mjs similarity index 100% rename from cli/utils/templates.mjs rename to cli/templates.mjs