mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-04-27 07:21:20 +00:00
feat: debugForms configuration to vite.config.ts
This commit is contained in:
parent
7242d8997e
commit
a240bce68c
9 changed files with 19 additions and 16 deletions
|
@ -1,6 +1,8 @@
|
|||
const SITE_URL =
|
||||
import.meta.env.VERCEL_ENV === 'preview' ? import.meta.env.VERCEL_URL : 'omnidash.io';
|
||||
|
||||
export const debugForms = import.meta.env.DEBUG_FORMS === 'true' || false;
|
||||
|
||||
export const siteConfig = {
|
||||
name: 'Omnidash',
|
||||
author: 'Bart van der Braak',
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
// import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { cn } from '$lib/utils';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let data: SuperValidated<Infer<LoginFormSchema>>;
|
||||
let isLoading = false;
|
||||
|
@ -72,7 +73,7 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$formData} />
|
||||
</div>
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
// import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { cn } from '$lib/utils';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let data: SuperValidated<Infer<RegisterFormSchema>>;
|
||||
let isLoading = false;
|
||||
|
@ -86,7 +87,7 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$formData} />
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import PocketBase from 'pocketbase';
|
||||
|
@ -22,6 +21,7 @@
|
|||
import { Separator } from '$lib/components/ui/separator';
|
||||
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
||||
import { ChevronDown } from 'radix-icons-svelte';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let data: SuperValidated<Infer<SsoFormSchema>>;
|
||||
let isLoading = false;
|
||||
|
@ -138,7 +138,7 @@
|
|||
</div>
|
||||
</form>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$formData} />
|
||||
</div>
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import type { LayoutData } from '../$types';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Separator } from '$lib/components/ui/separator';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let user: LayoutData['user'];
|
||||
export let requestData: SuperValidated<Infer<EmailRequestFormSchema>>;
|
||||
|
@ -91,7 +91,7 @@
|
|||
<Form.FieldErrors />
|
||||
</Form.Field>
|
||||
</form>
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$requestFormData} />
|
||||
</div>
|
||||
|
@ -130,7 +130,7 @@
|
|||
</Form.Button>
|
||||
</form>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$confirmFormData} />
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import type { LayoutData } from '../$types';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let user: LayoutData['user'];
|
||||
export let data: SuperValidated<Infer<UsernameFormSchema>>;
|
||||
|
@ -67,7 +67,7 @@
|
|||
</Form.Button>
|
||||
</form>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$formData} />
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import SuperDebug, { type SuperValidated, type Infer, superForm } from 'sveltekit-superforms';
|
||||
import * as Card from '$lib/components/ui/card';
|
||||
import * as Form from '$lib/components/ui/form';
|
||||
|
@ -22,6 +21,7 @@
|
|||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { setMode } from 'mode-watcher';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let data: SuperValidated<Infer<AppearanceFormSchema>>;
|
||||
let isLoading = false;
|
||||
|
@ -141,7 +141,7 @@
|
|||
</Form.Button>
|
||||
</form>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<SuperDebug data={$formData} />
|
||||
{/if}
|
||||
</Card.Content>
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
import SuperDebug from 'sveltekit-superforms';
|
||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_DEBUG_FORMS } from '$env/static/public';
|
||||
import type { LayoutData } from '../$types';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { Icons } from '$lib/components/site';
|
||||
import { debugForms } from '$lib/config/site';
|
||||
|
||||
export let user: LayoutData['user'];
|
||||
export let data: SuperValidated<Infer<ProfileFormSchema>>;
|
||||
|
@ -68,7 +68,7 @@
|
|||
</Form.Button>
|
||||
</form>
|
||||
|
||||
{#if dev && PUBLIC_DEBUG_FORMS == 'true' && browser}
|
||||
{#if dev && debugForms && browser}
|
||||
<div class="pt-4">
|
||||
<SuperDebug data={$formData} />
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue