Skip to content

Commit

Permalink
chore: Update Vuetify module and configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
adhamfarrag committed Sep 20, 2024
1 parent 2c4228a commit 740239b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"typescript.tsc.autoDetect": "off",
"editor.formatOnSave": true,
"eslint.useFlatConfig": true
"eslint.useFlatConfig": true,
"cSpell.words": [
"unocss",
"vuetify"
]
}
14 changes: 6 additions & 8 deletions src/commands/CSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ enum TailwindOptions {
}

enum UnoCSSOptions {
installModule = 'Install unocss/nuxt module and add it to nuxt config',
installModule = 'Install @UnoCSS/Nuxt module and add it to nuxt config',
createConfigFile = 'Create uno.config.ts file',
}

enum VuetifyOptions {
installModule = 'Install @nuxtjs/vuetify module and add it to nuxt config',
createConfigFile = 'Create vuetify.options.js file',
installModule = 'Install vuetify-nuxt-module module and add it to nuxt config',
createConfigFile = 'Create vuetify.config.ts file',
}

function configureCSS() {
Expand All @@ -40,10 +40,8 @@ function configureCSS() {
}
case 'Vuetify': {
configureVuetify()

break;
}
// No default
}
})
}
Expand Down Expand Up @@ -167,7 +165,7 @@ const configureUno = async () => {

const configureVuetify = async () => {
try {
const filePath = `${await projectSrcDirectory()}/vuetify.options.js`
const filePath = `${await projectSrcDirectory()}/vuetify.config.ts`

const vuetifyOptions = Object.values(VuetifyOptions)

Expand All @@ -179,7 +177,7 @@ const configureVuetify = async () => {
.then(async (selections) => {
if (selections !== undefined && selections.length > 0) {
if (selections.includes(VuetifyOptions.installModule)) {
const moduleName = '@nuxtjs/vuetify'
const moduleName = 'vuetify-nuxt-module'
const command = await getInstallationCommand(moduleName, true)

await runCommand({
Expand All @@ -194,7 +192,7 @@ const configureVuetify = async () => {

if (selections.includes(VuetifyOptions.createConfigFile)) {
await createFile({
fileName: `vuetify.options.js`,
fileName: `vuetify.config.ts`,
content: vuetifyConfigFile,
fullPath: filePath,
})
Expand Down
14 changes: 5 additions & 9 deletions src/templates/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ const tailwindCSSFile = `@tailwind base;
@tailwind components;
@tailwind utilities;`

const vuetifyConfigFile = `// vuetify.options.js
export default {
breakpoint: {},
icons: {},
lang: {},
rtl: true,
theme: {}
}
`
const vuetifyConfigFile = `import { defineVuetifyConfiguration } from 'vuetify-nuxt-module/custom-configuration'
export default defineVuetifyConfiguration({
})`

export {
unoCSSConfig,
Expand Down

0 comments on commit 740239b

Please sign in to comment.