Skip to content

Commit

Permalink
Fix CI build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Jan 8, 2025
1 parent f710ede commit 38b3d6f
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 44 deletions.
6 changes: 1 addition & 5 deletions src/lib/components/LightSwitch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
}
</script>

<Dialog.Root
open={pendingScheme !== undefined}
onOpenChange={handleOpenChanged}
controlledOpen={true}
>
<Dialog.Root bind:open={() => pendingScheme !== undefined, handleOpenChanged}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Switch to light mode</Dialog.Title>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/button/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{#if href}
<a
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
class={cn(buttonVariants({ variant, size }), className)}
{href}
{...restProps}
>
Expand All @@ -65,7 +65,7 @@
{:else}
<button
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
class={cn(buttonVariants({ variant, size }), className)}
{type}
{...restProps}
>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/input/input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<input
bind:this={ref}
class={cn(
"border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
bind:value
Expand Down
10 changes: 2 additions & 8 deletions src/lib/components/ui/sidebar/sidebar-provider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,20 @@
ref = $bindable(null),
open = $bindable(true),
onOpenChange = () => {},
controlledOpen = false,
class: className,
style,
children,
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
open?: boolean;
onOpenChange?: (open: boolean) => void;
controlledOpen?: boolean;
} = $props();
const sidebar = setSidebar({
open: () => open,
setOpen: (value: boolean) => {
if (controlledOpen) {
onOpenChange(value);
} else {
open = value;
onOpenChange(value);
}
open = value;
onOpenChange(value);
// This sets the cookie to keep the sidebar state.
document.cookie = `${SIDEBAR_COOKIE_NAME}=${open}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/ui/sidebar/sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
</div>
{:else if sidebar.isMobile}
<Sheet.Root
controlledOpen
open={sidebar.openMobile}
onOpenChange={sidebar.setOpenMobile}
bind:open={() => sidebar.openMobile, (v) => sidebar.setOpenMobile(v)}
{...restProps}
>
<Sheet.Content
Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/ui/toggle/toggle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import { type VariantProps, tv } from "tailwind-variants";
export const toggleVariants = tv({
base: "ring-offset-background hover:bg-muted hover:text-muted-foreground focus-visible:ring-ring data-[state=on]:bg-accent data-[state=on]:text-accent-foreground inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
base: "ring-offset-background hover:bg-muted hover:text-muted-foreground focus-visible:ring-ring data-[state=on]:bg-accent data-[state=on]:text-accent-foreground inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
variants: {
variant: {
default: "bg-transparent",
outline:
"border-input hover:bg-accent hover:text-accent-foreground border bg-transparent",
},
size: {
default: "h-10 px-3",
sm: "h-9 px-2.5",
lg: "h-11 px-5",
default: "h-10 min-w-10 px-3",
sm: "h-9 min-w-9 px-2.5",
lg: "h-11 min-w-11 px-5",
},
},
defaultVariants: {
Expand Down Expand Up @@ -46,6 +46,6 @@
<TogglePrimitive.Root
bind:ref
bind:pressed
class={cn(toggleVariants({ variant, size, className }))}
class={cn(toggleVariants({ variant, size }), className)}
{...restProps}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let { open = $bindable<boolean>(), user }: Props = $props();
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Delete user</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
let { open = $bindable<boolean>(), user }: Props = $props();
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Edit user</Dialog.Title>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(authenticated)/hubs/dialog-hub-delete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Delete hub</Dialog.Title>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(authenticated)/hubs/dialog-hub-edit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let { open = $bindable<boolean>(), hub }: Props = $props();
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Edit hub</Dialog.Title>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(authenticated)/hubs/dialog-hub-update.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let { open = $bindable<boolean>(), hub }: Props = $props();
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Update hub</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>API Token Generated</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Are you sure you want to delete <b>{token?.name}</b>?</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
let nameValidationResult = $derived(nameValidation(name));
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Edit API Token</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

<TokenCreatedDialog bind:open={createdDialog} {token} />

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Generate a new API Token</Dialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
);
</script>

<Dialog.Root {open} onOpenChange={(o) => (open = o)} controlledOpen={true}>
<Dialog.Root bind:open={() => open, (o) => (open = o)}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Revoke session</Dialog.Title>
Expand Down
6 changes: 1 addition & 5 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@

<Toaster />

<SidebarProvider
open={isOpen && isLoggedIn}
onOpenChange={(open) => (isOpen = open)}
controlledOpen={true}
>
<SidebarProvider bind:open={() => isOpen && isLoggedIn, (o) => (isOpen = o)}>
<AppSidebar currentUserRank={currentUserRank ?? RankType.User} />
<div class="flex min-h-screen flex-1 flex-col">
<Header />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/flashtool/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
</Card.Content>
</div>

<Sheet controlledOpen={true} open={terminalOpen} onOpenChange={(open) => (terminalOpen = open)}>
<Sheet bind:open={() => terminalOpen, (o) => (terminalOpen = o)}>
<SheetContent>
<SheetHeader>
<SheetTitle class="flex items-center">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/flashtool/HelpDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
</script>

<Dialog.Root {open} {onOpenChange} controlledOpen={true}>
<Dialog.Root bind:open={() => open, onOpenChange}>
<Dialog.Content class="max-w-fit">
<Dialog.Header>
<Dialog.Title>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/signup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
</script>

<Dialog.Root open={accountCreated} {onOpenChange} controlledOpen={true}>
<Dialog.Root bind:open={() => accountCreated, onOpenChange}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Account created</Dialog.Title>
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import dns from 'dns';
import { env } from 'process';
import { defineConfig, loadEnv, type PluginOption } from 'vite';
import { defineConfig, loadEnv, type PluginOption, type UserConfig } from 'vite';
import mkcert from 'vite-plugin-mkcert';

function printRed(message: string) {
Expand Down Expand Up @@ -102,5 +102,5 @@ export default defineConfig(async ({ command, mode, isPreview }) => {
plugins: await getPlugins(useLocalRedirect),
server: await getServer(mode, useLocalRedirect),
test: getTest(),
});
} as UserConfig); // TODO: "test" is not a valid property of the defineconfig argument? This needs to get fixed
});

0 comments on commit 38b3d6f

Please sign in to comment.