From acc675bd36075d689ee9bdfcec0f7876ec179c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brito?= Date: Fri, 3 Jan 2025 16:47:31 -0400 Subject: [PATCH] style: formatted and added example env --- .vscode/settings.json | 5 +- apps/api/scripts/mock-basic.json | 2 +- apps/public/components.json | 2 +- apps/public/lib/utils.ts | 6 +- apps/public/tailwind.config.js | 172 ++++++++++++++-------------- packages/email/src/index.tsx | 16 +-- packages/integrations/tsconfig.json | 2 +- self-hosting/.env.template | 3 +- 8 files changed, 106 insertions(+), 102 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7fcbc553..e1eb0bea 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,7 +23,10 @@ "tailwindCSS.experimental.classRegex": [ ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"], - ["\\b\\w+ClassName\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "[\"'`]([^\"'`]*)[\"'`]" ] + [ + "\\b\\w+ClassName\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", + "[\"'`]([^\"'`]*)[\"'`]" + ] ], "typescript.enablePromptUseWorkspaceTsdk": true, "typescript.tsdk": "node_modules/typescript/lib", diff --git a/apps/api/scripts/mock-basic.json b/apps/api/scripts/mock-basic.json index 9743482e..c8b5c6e9 100644 --- a/apps/api/scripts/mock-basic.json +++ b/apps/api/scripts/mock-basic.json @@ -32273,4 +32273,4 @@ } } } -] \ No newline at end of file +] diff --git a/apps/public/components.json b/apps/public/components.json index 9528fa10..d195b605 100644 --- a/apps/public/components.json +++ b/apps/public/components.json @@ -17,4 +17,4 @@ "lib": "@/lib", "hooks": "@/hooks" } -} \ No newline at end of file +} diff --git a/apps/public/lib/utils.ts b/apps/public/lib/utils.ts index bd0c391d..2819a830 100644 --- a/apps/public/lib/utils.ts +++ b/apps/public/lib/utils.ts @@ -1,6 +1,6 @@ -import { clsx, type ClassValue } from "clsx" -import { twMerge } from "tailwind-merge" +import { clsx, type ClassValue } from 'clsx'; +import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) + return twMerge(clsx(inputs)); } diff --git a/apps/public/tailwind.config.js b/apps/public/tailwind.config.js index 3cdf0b4c..2aeb5ed4 100644 --- a/apps/public/tailwind.config.js +++ b/apps/public/tailwind.config.js @@ -2,8 +2,8 @@ import { createPreset } from 'fumadocs-ui/tailwind-plugin'; /** @type {import('tailwindcss').Config} */ export default { - darkMode: ['class'], - content: [ + darkMode: ['class'], + content: [ './components/**/*.{ts,tsx}', './app/**/*.{ts,tsx}', './content/**/*.{md,mdx}', @@ -11,88 +11,88 @@ export default { './node_modules/fumadocs-ui/dist/**/*.js', ], presets: [createPreset()], - plugins: [require("tailwindcss-animate")], - corePlugins: { - container: false - }, - theme: { - extend: { - screens: { - article: '1530px', - }, - borderRadius: { - lg: 'var(--radius)', - md: 'calc(var(--radius) - 2px)', - sm: 'calc(var(--radius) - 4px)' - }, - colors: { - background: 'hsl(var(--background))', - 'background-light': 'hsl(var(--background-light))', - 'background-dark': 'hsl(var(--background-dark))', - foreground: 'hsl(var(--foreground))', - 'foreground-dark': 'hsl(var(--foreground-dark))', - 'foreground-light': 'hsl(var(--foreground-light))', - card: { - DEFAULT: 'hsl(var(--card))', - foreground: 'hsl(var(--card-foreground))' - }, - popover: { - DEFAULT: 'hsl(var(--popover))', - foreground: 'hsl(var(--popover-foreground))' - }, - primary: { - DEFAULT: 'hsl(var(--primary))', - foreground: 'hsl(var(--primary-foreground))' - }, - secondary: { - DEFAULT: 'hsl(var(--secondary))', - foreground: 'hsl(var(--secondary-foreground))' - }, - muted: { - DEFAULT: 'hsl(var(--muted))', - foreground: 'hsl(var(--muted-foreground))' - }, - accent: { - DEFAULT: 'hsl(var(--accent))', - foreground: 'hsl(var(--accent-foreground))' - }, - destructive: { - DEFAULT: 'hsl(var(--destructive))', - foreground: 'hsl(var(--destructive-foreground))' - }, - border: 'hsl(var(--border))', - input: 'hsl(var(--input))', - ring: 'hsl(var(--ring))', - chart: { - '1': 'hsl(var(--chart-1))', - '2': 'hsl(var(--chart-2))', - '3': 'hsl(var(--chart-3))', - '4': 'hsl(var(--chart-4))', - '5': 'hsl(var(--chart-5))' - } - }, - keyframes: { - 'accordion-down': { - from: { - height: '0' - }, - to: { - height: 'var(--radix-accordion-content-height)' - } - }, - 'accordion-up': { - from: { - height: 'var(--radix-accordion-content-height)' - }, - to: { - height: '0' - } - } - }, - animation: { - 'accordion-down': 'accordion-down 0.2s ease-out', - 'accordion-up': 'accordion-up 0.2s ease-out' - } - } - } + plugins: [require('tailwindcss-animate')], + corePlugins: { + container: false, + }, + theme: { + extend: { + screens: { + article: '1530px', + }, + borderRadius: { + lg: 'var(--radius)', + md: 'calc(var(--radius) - 2px)', + sm: 'calc(var(--radius) - 4px)', + }, + colors: { + background: 'hsl(var(--background))', + 'background-light': 'hsl(var(--background-light))', + 'background-dark': 'hsl(var(--background-dark))', + foreground: 'hsl(var(--foreground))', + 'foreground-dark': 'hsl(var(--foreground-dark))', + 'foreground-light': 'hsl(var(--foreground-light))', + card: { + DEFAULT: 'hsl(var(--card))', + foreground: 'hsl(var(--card-foreground))', + }, + popover: { + DEFAULT: 'hsl(var(--popover))', + foreground: 'hsl(var(--popover-foreground))', + }, + primary: { + DEFAULT: 'hsl(var(--primary))', + foreground: 'hsl(var(--primary-foreground))', + }, + secondary: { + DEFAULT: 'hsl(var(--secondary))', + foreground: 'hsl(var(--secondary-foreground))', + }, + muted: { + DEFAULT: 'hsl(var(--muted))', + foreground: 'hsl(var(--muted-foreground))', + }, + accent: { + DEFAULT: 'hsl(var(--accent))', + foreground: 'hsl(var(--accent-foreground))', + }, + destructive: { + DEFAULT: 'hsl(var(--destructive))', + foreground: 'hsl(var(--destructive-foreground))', + }, + border: 'hsl(var(--border))', + input: 'hsl(var(--input))', + ring: 'hsl(var(--ring))', + chart: { + 1: 'hsl(var(--chart-1))', + 2: 'hsl(var(--chart-2))', + 3: 'hsl(var(--chart-3))', + 4: 'hsl(var(--chart-4))', + 5: 'hsl(var(--chart-5))', + }, + }, + keyframes: { + 'accordion-down': { + from: { + height: '0', + }, + to: { + height: 'var(--radix-accordion-content-height)', + }, + }, + 'accordion-up': { + from: { + height: 'var(--radix-accordion-content-height)', + }, + to: { + height: '0', + }, + }, + }, + animation: { + 'accordion-down': 'accordion-down 0.2s ease-out', + 'accordion-up': 'accordion-up 0.2s ease-out', + }, + }, + }, }; diff --git a/packages/email/src/index.tsx b/packages/email/src/index.tsx index be3ca64a..b3ad4403 100644 --- a/packages/email/src/index.tsx +++ b/packages/email/src/index.tsx @@ -1,16 +1,16 @@ -import React from "react"; -import { Resend } from "resend"; -import type { z } from "zod"; +import React from 'react'; +import { Resend } from 'resend'; +import type { z } from 'zod'; -import { type TemplateKey, type Templates, templates } from "./emails"; +import { type TemplateKey, type Templates, templates } from './emails'; -const FROM = process.env.EMAIL_SENDER ?? "hello@openpanel.dev"; +const FROM = process.env.EMAIL_SENDER ?? 'hello@openpanel.dev'; export async function sendEmail( template: T, options: { to: string | string[]; - data: z.infer; + data: z.infer; }, ) { const { to, data } = options; @@ -18,7 +18,7 @@ export async function sendEmail( const props = schema.safeParse(data); if (props.error) { - console.error("Failed to parse data", props.error); + console.error('Failed to parse data', props.error); return null; } @@ -46,7 +46,7 @@ export async function sendEmail( return res; } catch (error) { - console.error("Failed to send email", error); + console.error('Failed to send email', error); return null; } } diff --git a/packages/integrations/tsconfig.json b/packages/integrations/tsconfig.json index b1ff68c0..a291eef2 100644 --- a/packages/integrations/tsconfig.json +++ b/packages/integrations/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": ["./src/*"], + "@/*": ["./src/*"] }, "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, diff --git a/self-hosting/.env.template b/self-hosting/.env.template index d7e13bd5..ab511d0e 100644 --- a/self-hosting/.env.template +++ b/self-hosting/.env.template @@ -12,4 +12,5 @@ DATABASE_URL="$DATABASE_URL" DATABASE_URL_DIRECT="$DATABASE_URL_DIRECT" NEXT_PUBLIC_DASHBOARD_URL="$NEXT_PUBLIC_DASHBOARD_URL" NEXT_PUBLIC_API_URL="$NEXT_PUBLIC_API_URL" -COOKIE_SECRET="$COOKIE_SECRET" \ No newline at end of file +COOKIE_SECRET="$COOKIE_SECRET" +EMAIL_SENDER=no-repy@openpanel.dev \ No newline at end of file