From baea02d14cc43bead3838bd2c359e4641e0b7635 Mon Sep 17 00:00:00 2001 From: Arunanshu Biswas <48434243+arunanshub@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:42:48 +0530 Subject: [PATCH] style(biome): format files and configure for vcs (#183) --- biome.json | 5 +++++ drizzle.config.ts | 3 +-- migrate.ts | 7 ++++++- nuxt.config.ts | 34 +++++++++++++++++++++++----------- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/biome.json b/biome.json index 8cf7f96..511d5f0 100644 --- a/biome.json +++ b/biome.json @@ -14,5 +14,10 @@ }, "javascript": { "formatter": { "semicolons": "asNeeded", "quoteStyle": "single" } + }, + "vcs": { + "enabled": true, + "useIgnoreFile": true, + "clientKind": "git" } } diff --git a/drizzle.config.ts b/drizzle.config.ts index b610b00..67c26fc 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -6,7 +6,6 @@ export default { schema: 'src/server/database/schema/*', driver: 'mysql2', dbCredentials: { - uri: process.env.DATABASE_URL!, - database: process.env.DATABASE_NAME!, + uri: process.env.DATABASE_URL as NonNullable, }, } satisfies Config diff --git a/migrate.ts b/migrate.ts index ee28ca4..78e9a37 100644 --- a/migrate.ts +++ b/migrate.ts @@ -2,7 +2,12 @@ import 'dotenv/config' import { migrate } from 'drizzle-orm/planetscale-serverless/migrator' import { getDb } from '~/server/database/db' +const databaseUrl = process.env.DATABASE_URL + +if (!databaseUrl) { + throw Error('Database URL not configured in environment variable') +} // This will run migrations on the database, skipping the ones already applied -await migrate(getDb(process.env.DATABASE_URL!), { +await migrate(getDb(databaseUrl), { migrationsFolder: './src/server/database/migrations', }) diff --git a/nuxt.config.ts b/nuxt.config.ts index 1a3ac9c..b9ef622 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,5 +1,5 @@ -import browserslistToEsbuild from 'browserslist-to-esbuild' import tailwindTypography from '@tailwindcss/typography' +import browserslistToEsbuild from 'browserslist-to-esbuild' // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ @@ -7,7 +7,7 @@ export default defineNuxtConfig({ srcDir: 'src/', app: { head: { - titleTemplate: `%s · Distrohop`, + titleTemplate: '%s · Distrohop', // manually add lang until we use nuxt-i18n htmlAttrs: { lang: 'en' }, }, @@ -19,14 +19,26 @@ export default defineNuxtConfig({ }, // Modules - modules: [// Image Handling and Optimization - '@nuxt/image', // Performance Optimization - '@nuxtjs/critters', 'nuxt-delay-hydration', // Content Management - '@nuxt/content', // Utility Functions - '@vueuse/nuxt', // Fonts and Typography - '@nuxtjs/fontaine', '@nuxtjs/google-fonts', '@nuxtjs/tailwindcss', // SEO and Crawling - '@nuxtjs/robots', // Icons - 'nuxt-icon', "nuxt-build-cache"], + modules: [ + // Image Handling and Optimization + '@nuxt/image', + // Performance Optimization + '@nuxtjs/critters', + 'nuxt-delay-hydration', + // Content Management + '@nuxt/content', + // Utility Functions + '@vueuse/nuxt', + // Fonts and Typography + '@nuxtjs/fontaine', + '@nuxtjs/google-fonts', + '@nuxtjs/tailwindcss', + // SEO and Crawling + '@nuxtjs/robots', + // Icons + 'nuxt-icon', + 'nuxt-build-cache', + ], // Module Options content: { @@ -106,4 +118,4 @@ export default defineNuxtConfig({ }, }, }, -}) \ No newline at end of file +})