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