diff --git a/.prettierignore b/.prettierignore index ab78a95..7566eee 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,9 @@ package-lock.json pnpm-lock.yaml yarn.lock + +# Dont even try lol +.svelte-kit +build +node_modules + diff --git a/devops/docker-compose.dev.yml b/devops/docker-compose.dev.yml index 18c751d..b345725 100644 --- a/devops/docker-compose.dev.yml +++ b/devops/docker-compose.dev.yml @@ -1,10 +1,10 @@ services: postgres: - container_name: postgres + container_name: postgres:alpine image: postgres + ports: + - 5432:5432 environment: POSTGRES_DB: ${DATABASE_NAME} POSTGRES_USER: ${DATABASE_USERNAME} POSTGRES_PASSWORD: ${DATABASE_PASSWORD} - volumes: - - ./data:/var/lib/postgresql/data diff --git a/postcss.config.js b/postcss.config.js index 6499d20..8c0f51b 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,5 @@ export default { plugins: { - autoprefixer: {}, - }, + autoprefixer: {} + } }; diff --git a/src/app.css b/src/app.css index 5b93173..d6c48cb 100644 --- a/src/app.css +++ b/src/app.css @@ -1,4 +1,4 @@ -@import "tailwindcss"; +@import 'tailwindcss'; @plugin "daisyui"; :root { diff --git a/src/routes/contact/+page.server.ts b/src/routes/contact/+page.server.ts index b469008..d25477b 100644 --- a/src/routes/contact/+page.server.ts +++ b/src/routes/contact/+page.server.ts @@ -2,86 +2,84 @@ import { MAIL_TRANSPORT_HOST, MAIL_TRANSPORT_PASS, MAIL_TRANSPORT_PORT, - MAIL_TRANSPORT_USER, -} from "$env/static/private"; -import { fail } from "@sveltejs/kit"; -import { createTransport } from "nodemailer"; -import type { Actions } from "./$types"; + MAIL_TRANSPORT_USER +} from '$env/static/private'; +import { fail } from '@sveltejs/kit'; +import { createTransport } from 'nodemailer'; +import type { Actions } from './$types'; export const actions = { default: async ({ request }) => { const form = await request.formData(); - if (!form.has("name")) { + if (!form.has('name')) { return fail(400, { name: null, missing: true }); } - if (!form.has("email")) { + if (!form.has('email')) { return fail(400, { email: null, missing: true }); } - if (!form.has("subject")) { + if (!form.has('subject')) { return fail(400, { subject: null, missing: true }); } - if (!form.has("message")) { + if (!form.has('message')) { return fail(400, { message: null, missing: true }); } - const name = form.get("name"); - if (typeof name !== "string") { + const name = form.get('name'); + if (typeof name !== 'string') { return fail(400, { name, incorrect: true }); } - const email = form.get("email"); - if (typeof email !== "string") { + const email = form.get('email'); + if (typeof email !== 'string') { return fail(400, { email, incorrect: true }); } - const subject = form.get("subject"); - if (typeof subject !== "string") { + const subject = form.get('subject'); + if (typeof subject !== 'string') { return fail(400, { subject, incorrect: true }); } - const message = form.get("message"); - if (typeof message !== "string") { + const message = form.get('message'); + if (typeof message !== 'string') { return fail(400, { message, incorrect: true }); } const transport = createTransport({ host: MAIL_TRANSPORT_HOST, - port: isNaN(Number(MAIL_TRANSPORT_PORT)) - ? 587 - : Number(MAIL_TRANSPORT_PORT), + port: isNaN(Number(MAIL_TRANSPORT_PORT)) ? 587 : Number(MAIL_TRANSPORT_PORT), auth: { user: MAIL_TRANSPORT_USER, - pass: MAIL_TRANSPORT_PASS, - }, + pass: MAIL_TRANSPORT_PASS + } }); try { const info1 = await transport.sendMail({ - from: "no-reply@benjaminpalko.ca", + from: 'no-reply@benjaminpalko.ca', to: email, subject: `Thank you for reaching out`, - text: `Hello ${name}!\n\nThank you for reaching out! I will be sure to get back to you ASAP.\n\nCheers,\nBenjamin`, + text: `Hello ${name}!\n\nThank you for reaching out! I will be sure to get back to you ASAP.\n\nCheers,\nBenjamin` }); const info2 = await transport.sendMail({ from: email, - to: "contact@benjaminpalko.ca", + to: 'contact@benjaminpalko.ca', subject: subject, - text: message, + text: message }); return { response: { accepted: [...info1.accepted, ...info2.accepted], - rejected: [...info1.rejected, ...info2.rejected], - }, + rejected: [...info1.rejected, ...info2.rejected] + } }; } catch (error) { console.error(error); } - }, + } } satisfies Actions; diff --git a/tailwind.config.ts b/tailwind.config.ts index 6a3aa45..ab0713f 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,9 +1,9 @@ -import type { Config } from "tailwindcss"; +import type { Config } from 'tailwindcss'; export default { - content: ["./src/**/*.{html,js,svelte,ts}"], + content: ['./src/**/*.{html,js,svelte,ts}'], theme: { - extend: {}, - }, + extend: {} + } } satisfies Config; diff --git a/vite.config.ts b/vite.config.ts index bbb4f92..b8062e6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,11 @@ -import { sveltekit } from "@sveltejs/kit/vite"; -import tailwindcss from "@tailwindcss/vite"; -import { defineConfig } from "vitest/config"; +import { sveltekit } from '@sveltejs/kit/vite'; +import tailwindcss from '@tailwindcss/vite'; +import { defineConfig } from 'vitest/config'; export default defineConfig({ plugins: [tailwindcss(), sveltekit()], test: { - include: ["src/**/*.{test,spec}.{js,ts}"], - }, + include: ['src/**/*.{test,spec}.{js,ts}'] + } });