style: Organize imports
This commit is contained in:
parent
e2bb1f6347
commit
52bd4e4ce4
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MessageSquare from 'lucide-svelte/icons/message-square';
|
|
||||||
import { page } from '$app/state';
|
import { page } from '$app/state';
|
||||||
|
import MessageSquare from 'lucide-svelte/icons/message-square';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
channelName: string;
|
channelName: string;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
import { Button, buttonVariants } from '$lib/components/ui/button/index.js';
|
import { Button, buttonVariants } from '$lib/components/ui/button/index.js';
|
||||||
import * as Dialog from '$lib/components/ui/dialog/index.js';
|
import * as Dialog from '$lib/components/ui/dialog/index.js';
|
||||||
import { Input } from '$lib/components/ui/input/index.js';
|
import { Input } from '$lib/components/ui/input/index.js';
|
||||||
import type { SuperValidated, Infer } from 'sveltekit-superforms';
|
|
||||||
import { superForm } from 'sveltekit-superforms';
|
|
||||||
import type { NewChannelSchema } from '$lib/types/schema';
|
|
||||||
import { Label } from '$lib/components/ui/label/index';
|
import { Label } from '$lib/components/ui/label/index';
|
||||||
|
import type { NewChannelSchema } from '$lib/types/schema';
|
||||||
|
import type { Infer, SuperValidated } from 'sveltekit-superforms';
|
||||||
|
import { superForm } from 'sveltekit-superforms';
|
||||||
|
|
||||||
let open: boolean = $state(false);
|
let open: boolean = $state(false);
|
||||||
let { data }: { data: SuperValidated<Infer<NewChannelSchema>> } = $props();
|
let { data }: { data: SuperValidated<Infer<NewChannelSchema>> } = $props();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MessagesSquare from 'lucide-svelte/icons/messages-square';
|
import MessagesSquare from 'lucide-svelte/icons/messages-square';
|
||||||
|
import type { Snippet } from 'svelte';
|
||||||
import type { SuperValidated } from 'sveltekit-superforms';
|
import type { SuperValidated } from 'sveltekit-superforms';
|
||||||
|
import Channel from './channel.svelte';
|
||||||
import ChannelDialog from './channelDialog.svelte';
|
import ChannelDialog from './channelDialog.svelte';
|
||||||
import ModeSwitcher from './modeSwitcher.svelte';
|
import ModeSwitcher from './modeSwitcher.svelte';
|
||||||
import Channel from './channel.svelte';
|
|
||||||
import type { Snippet } from 'svelte';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: SuperValidated<
|
data: SuperValidated<
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Sun from 'lucide-svelte/icons/sun';
|
|
||||||
import Moon from 'lucide-svelte/icons/moon-star';
|
|
||||||
import { toggleMode } from 'mode-watcher';
|
|
||||||
import { Button } from '$lib/components/ui/button/index';
|
import { Button } from '$lib/components/ui/button/index';
|
||||||
|
import Moon from 'lucide-svelte/icons/moon-star';
|
||||||
|
import Sun from 'lucide-svelte/icons/sun';
|
||||||
|
import { toggleMode } from 'mode-watcher';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button on:click={toggleMode} variant="secondary" size="icon" class="ml-auto">
|
<Button on:click={toggleMode} variant="secondary" size="icon" class="ml-auto">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { TypeMessage, TypeFullMessage } from '$lib/types';
|
import type { TypeFullMessage, TypeMessage } from '$lib/types';
|
||||||
import type { Socket } from 'socket.io-client';
|
import type { Socket } from 'socket.io-client';
|
||||||
|
|
||||||
class Websocket {
|
class Websocket {
|
||||||
|
@ -2,8 +2,8 @@ import { Server as SocketIOServer } from 'socket.io';
|
|||||||
import type { HttpServer } from 'vite';
|
import type { HttpServer } from 'vite';
|
||||||
// Don't try to replace with $lib alias. Since this
|
// Don't try to replace with $lib alias. Since this
|
||||||
// file gets loaded as a vite plugin, it will crash
|
// file gets loaded as a vite plugin, it will crash
|
||||||
import { db } from '../server/db';
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import { db } from '../server/db';
|
||||||
|
|
||||||
let io: SocketIOServer | undefined;
|
let io: SocketIOServer | undefined;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { building } from '$app/environment';
|
import { building } from '$app/environment';
|
||||||
|
import { startupSocketIOServer } from '$lib/functions/websocketConfig';
|
||||||
import type { Handle } from '@sveltejs/kit';
|
import type { Handle } from '@sveltejs/kit';
|
||||||
import { Server as SocketIOServer } from 'socket.io';
|
import { Server as SocketIOServer } from 'socket.io';
|
||||||
import { startupSocketIOServer } from '$lib/functions/websocketConfig';
|
|
||||||
|
|
||||||
let io: SocketIOServer | undefined;
|
let io: SocketIOServer | undefined;
|
||||||
export const handle = (async ({ event, resolve }) => {
|
export const handle = (async ({ event, resolve }) => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { type ClassValue, clsx } from 'clsx';
|
import { type ClassValue, clsx } from 'clsx';
|
||||||
import { twMerge } from 'tailwind-merge';
|
|
||||||
import { cubicOut } from 'svelte/easing';
|
import { cubicOut } from 'svelte/easing';
|
||||||
import type { TransitionConfig } from 'svelte/transition';
|
import type { TransitionConfig } from 'svelte/transition';
|
||||||
|
import { twMerge } from 'tailwind-merge';
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return twMerge(clsx(inputs));
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state';
|
import { page } from '$app/state';
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import BrokenHeart from 'lucide-svelte/icons/heart-crack';
|
|
||||||
import * as Card from '$lib/components/ui/card';
|
import * as Card from '$lib/components/ui/card';
|
||||||
|
import BrokenHeart from 'lucide-svelte/icons/heart-crack';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="relative size-full">
|
<main class="relative size-full">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { db } from '$lib/server/db';
|
import { db } from '$lib/server/db';
|
||||||
import { zod } from 'sveltekit-superforms/adapters';
|
|
||||||
import { superValidate } from 'sveltekit-superforms';
|
|
||||||
import { newChannelSchema } from '$lib/types/schema';
|
import { newChannelSchema } from '$lib/types/schema';
|
||||||
|
import { superValidate } from 'sveltekit-superforms';
|
||||||
|
import { zod } from 'sveltekit-superforms/adapters';
|
||||||
|
|
||||||
export async function load() {
|
export async function load() {
|
||||||
const form = await superValidate(zod(newChannelSchema));
|
const form = await superValidate(zod(newChannelSchema));
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '../app.css';
|
|
||||||
import type { LayoutProps } from './$types';
|
|
||||||
import MainLayout from '$lib/components/mainLayout.svelte';
|
import MainLayout from '$lib/components/mainLayout.svelte';
|
||||||
import { ModeWatcher } from 'mode-watcher';
|
import { ModeWatcher } from 'mode-watcher';
|
||||||
|
import '../app.css';
|
||||||
|
import type { LayoutProps } from './$types';
|
||||||
let { data, children }: LayoutProps = $props();
|
let { data, children }: LayoutProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { redirect, fail } from '@sveltejs/kit';
|
|
||||||
import { zod } from 'sveltekit-superforms/adapters';
|
|
||||||
import { setError, superValidate, message } from 'sveltekit-superforms';
|
|
||||||
import { newChannelSchema } from '$lib/types/schema';
|
|
||||||
import type { Actions } from './$types';
|
|
||||||
import { db } from '$lib/server/db';
|
import { db } from '$lib/server/db';
|
||||||
|
import { newChannelSchema } from '$lib/types/schema';
|
||||||
|
import { fail, redirect } from '@sveltejs/kit';
|
||||||
|
import { message, setError, superValidate } from 'sveltekit-superforms';
|
||||||
|
import { zod } from 'sveltekit-superforms/adapters';
|
||||||
|
import type { Actions } from './$types';
|
||||||
|
|
||||||
export function load(): void {
|
export function load(): void {
|
||||||
redirect(308, '/channel/general');
|
redirect(308, '/channel/general');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
import { db } from '$lib/server/db';
|
||||||
import type { TypeMessage } from '$lib/types';
|
import type { TypeMessage } from '$lib/types';
|
||||||
import { error } from '@sveltejs/kit';
|
import { error } from '@sveltejs/kit';
|
||||||
import { db } from '$lib/server/db';
|
|
||||||
|
|
||||||
export async function load({ params }): Promise<{ messages: TypeMessage[] }> {
|
export async function load({ params }): Promise<{ messages: TypeMessage[] }> {
|
||||||
let messages: TypeMessage[];
|
let messages: TypeMessage[];
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { page } from '$app/state';
|
||||||
|
import Message from '$lib/components/message.svelte';
|
||||||
|
import { Button } from '$lib/components/ui/button/index';
|
||||||
|
import { Input } from '$lib/components/ui/input/index';
|
||||||
|
import Websocket from '$lib/functions/clientWebsocket.svelte';
|
||||||
|
import type { TypeMessage } from '$lib/types';
|
||||||
|
import Send from 'lucide-svelte/icons/send';
|
||||||
import { io } from 'socket.io-client';
|
import { io } from 'socket.io-client';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import type { TypeMessage } from '$lib/types';
|
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { Input } from '$lib/components/ui/input/index';
|
|
||||||
import { Button } from '$lib/components/ui/button/index';
|
|
||||||
import Send from 'lucide-svelte/icons/send';
|
|
||||||
import Message from '$lib/components/message.svelte';
|
|
||||||
import { page } from '$app/state';
|
|
||||||
import Websocket from '$lib/functions/clientWebsocket.svelte';
|
|
||||||
|
|
||||||
const { data }: { data: PageData } = $props();
|
const { data }: { data: PageData } = $props();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user