From 18a782243ee62755414eb05e457d70c662896c68 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 20 Apr 2024 02:35:52 +0100 Subject: [PATCH] move common dir --- src/app/(pages)/documentation/[[...slug]]/page.tsx | 4 ++-- src/app/(pages)/mojang/status/page.tsx | 8 ++++---- src/app/(pages)/player/[[...id]]/page.tsx | 6 +++--- .../(pages)/server/[platform]/[[...hostname]]/page.tsx | 10 +++++----- src/{ => app}/common/colors.ts | 0 src/{ => app}/common/documentation.ts | 0 src/{ => app}/common/embed.ts | 0 src/{ => app}/common/number-utils.ts | 0 src/{ => app}/common/player.ts | 0 src/{ => app}/common/server.ts | 0 src/{ => app}/common/string-utils.ts | 0 src/{ => app}/common/time-utils.ts | 0 src/{ => app}/common/use-toast.ts | 0 src/{ => app}/common/utils.ts | 0 src/app/components/card.tsx | 2 +- src/app/components/copy-button.tsx | 2 +- src/app/components/href-button.tsx | 2 +- src/app/components/mx-components.tsx | 5 +++-- src/app/components/navbar.tsx | 2 +- src/app/components/player/lookup-player.tsx | 2 +- src/app/components/player/skin-part-image.tsx | 2 +- src/app/components/server/lookup-server.tsx | 4 ++-- src/app/components/server/server-view.tsx | 2 +- src/app/components/ui/button.tsx | 2 +- src/app/components/ui/card.tsx | 2 +- src/app/components/ui/context-menu.tsx | 2 +- src/app/components/ui/dialog.tsx | 2 +- src/app/components/ui/input.tsx | 2 +- src/app/components/ui/label.tsx | 2 +- src/app/components/ui/popover.tsx | 2 +- src/app/components/ui/select.tsx | 2 +- src/app/components/ui/separator.tsx | 2 +- src/app/components/ui/table.tsx | 2 +- src/app/components/ui/toast.tsx | 2 +- src/app/components/ui/toaster.tsx | 2 +- src/app/components/ui/tooltip.tsx | 2 +- 36 files changed, 39 insertions(+), 38 deletions(-) rename src/{ => app}/common/colors.ts (100%) rename src/{ => app}/common/documentation.ts (100%) rename src/{ => app}/common/embed.ts (100%) rename src/{ => app}/common/number-utils.ts (100%) rename src/{ => app}/common/player.ts (100%) rename src/{ => app}/common/server.ts (100%) rename src/{ => app}/common/string-utils.ts (100%) rename src/{ => app}/common/time-utils.ts (100%) rename src/{ => app}/common/use-toast.ts (100%) rename src/{ => app}/common/utils.ts (100%) diff --git a/src/app/(pages)/documentation/[[...slug]]/page.tsx b/src/app/(pages)/documentation/[[...slug]]/page.tsx index c633a22..26f2054 100644 --- a/src/app/(pages)/documentation/[[...slug]]/page.tsx +++ b/src/app/(pages)/documentation/[[...slug]]/page.tsx @@ -1,7 +1,7 @@ -import { getDocumentation } from "@/common/documentation"; +import { getDocumentation } from "@/app/common/documentation"; import { CustomMDX } from "@/app/components/mx-components"; import { Metadata } from "next"; -import { generateEmbed } from "@/common/embed"; +import { generateEmbed } from "@/app/common/embed"; type DocumentationPageParams = { params: { diff --git a/src/app/(pages)/mojang/status/page.tsx b/src/app/(pages)/mojang/status/page.tsx index 2159ddf..e8fa25b 100644 --- a/src/app/(pages)/mojang/status/page.tsx +++ b/src/app/(pages)/mojang/status/page.tsx @@ -1,12 +1,12 @@ import { Card } from "@/app/components/card"; -import { generateEmbed } from "@/common/embed"; -import { capitalizeFirstLetter } from "@/common/string-utils"; -import { cn } from "@/common/utils"; +import { generateEmbed } from "@/app/common/embed"; +import { capitalizeFirstLetter } from "@/app/common/string-utils"; +import { cn } from "@/app/common/utils"; import { CachedEndpointStatus, getMojangEndpointStatus, Status } from "mcutils-library"; import { Metadata, Viewport } from "next"; import Link from "next/link"; import { ReactElement } from "react"; -import { Colors } from "@/common/colors"; +import { Colors } from "@/app/common/colors"; import { Title } from "@/app/components/title"; /** diff --git a/src/app/(pages)/player/[[...id]]/page.tsx b/src/app/(pages)/player/[[...id]]/page.tsx index 3eb873f..37d7966 100644 --- a/src/app/(pages)/player/[[...id]]/page.tsx +++ b/src/app/(pages)/player/[[...id]]/page.tsx @@ -4,9 +4,9 @@ import { ErrorCard } from "@/app/components/error-card"; import { LookupPlayer } from "@/app/components/player/lookup-player"; import { PlayerView } from "@/app/components/player/player-view"; import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "@/app/components/ui/context-menu"; -import { Colors } from "@/common/colors"; -import { generateEmbed } from "@/common/embed"; -import { isValidPlayer } from "@/common/player"; +import { Colors } from "@/app/common/colors"; +import { generateEmbed } from "@/app/common/embed"; +import { isValidPlayer } from "@/app/common/player"; import config from "@root/config.json"; import { CachedPlayer, getPlayer, McUtilsAPIError } from "mcutils-library"; import { Metadata, Viewport } from "next"; diff --git a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx index fa3df80..4298697 100644 --- a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx +++ b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx @@ -3,11 +3,11 @@ import { ErrorCard } from "@/app/components/error-card"; import { LookupServer } from "@/app/components/server/lookup-server"; import { ServerView } from "@/app/components/server/server-view"; import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "@/app/components/ui/context-menu"; -import { Colors } from "@/common/colors"; -import { generateEmbed } from "@/common/embed"; -import { formatNumber } from "@/common/number-utils"; -import { isValidServer } from "@/common/server"; -import { capitalizeFirstLetter } from "@/common/string-utils"; +import { Colors } from "@/app/common/colors"; +import { generateEmbed } from "@/app/common/embed"; +import { formatNumber } from "@/app/common/number-utils"; +import { isValidServer } from "@/app/common/server"; +import { capitalizeFirstLetter } from "@/app/common/string-utils"; import config from "@root/config.json"; import { CachedBedrockMinecraftServer, diff --git a/src/common/colors.ts b/src/app/common/colors.ts similarity index 100% rename from src/common/colors.ts rename to src/app/common/colors.ts diff --git a/src/common/documentation.ts b/src/app/common/documentation.ts similarity index 100% rename from src/common/documentation.ts rename to src/app/common/documentation.ts diff --git a/src/common/embed.ts b/src/app/common/embed.ts similarity index 100% rename from src/common/embed.ts rename to src/app/common/embed.ts diff --git a/src/common/number-utils.ts b/src/app/common/number-utils.ts similarity index 100% rename from src/common/number-utils.ts rename to src/app/common/number-utils.ts diff --git a/src/common/player.ts b/src/app/common/player.ts similarity index 100% rename from src/common/player.ts rename to src/app/common/player.ts diff --git a/src/common/server.ts b/src/app/common/server.ts similarity index 100% rename from src/common/server.ts rename to src/app/common/server.ts diff --git a/src/common/string-utils.ts b/src/app/common/string-utils.ts similarity index 100% rename from src/common/string-utils.ts rename to src/app/common/string-utils.ts diff --git a/src/common/time-utils.ts b/src/app/common/time-utils.ts similarity index 100% rename from src/common/time-utils.ts rename to src/app/common/time-utils.ts diff --git a/src/common/use-toast.ts b/src/app/common/use-toast.ts similarity index 100% rename from src/common/use-toast.ts rename to src/app/common/use-toast.ts diff --git a/src/common/utils.ts b/src/app/common/utils.ts similarity index 100% rename from src/common/utils.ts rename to src/app/common/utils.ts diff --git a/src/app/components/card.tsx b/src/app/components/card.tsx index d0f7b0a..8e24666 100644 --- a/src/app/components/card.tsx +++ b/src/app/components/card.tsx @@ -1,5 +1,5 @@ import { Card as ShadcnCard, CardContent } from "@/app/components/ui/card"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; import { ReactElement } from "react"; import { type ClassValue } from "clsx"; diff --git a/src/app/components/copy-button.tsx b/src/app/components/copy-button.tsx index e131413..c4de9a0 100644 --- a/src/app/components/copy-button.tsx +++ b/src/app/components/copy-button.tsx @@ -1,6 +1,6 @@ "use client"; -import { useToast } from "@/common/use-toast"; +import { useToast } from "@/app/common/use-toast"; import copy from "clipboard-copy"; import { ReactElement } from "react"; diff --git a/src/app/components/href-button.tsx b/src/app/components/href-button.tsx index 5c65a43..f376424 100644 --- a/src/app/components/href-button.tsx +++ b/src/app/components/href-button.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; import Link from "next/link"; import { ReactElement } from "react"; diff --git a/src/app/components/mx-components.tsx b/src/app/components/mx-components.tsx index e05459f..4ee332e 100644 --- a/src/app/components/mx-components.tsx +++ b/src/app/components/mx-components.tsx @@ -1,8 +1,9 @@ import { MDXRemote } from "remote-mdx/rsc"; import { CodeHighlighter } from "@/app/components/code-highlighter"; import { Separator } from "@/app/components/ui/separator"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; import Link from "next/link"; +import { ReactElement } from "react"; /** * Create a heading component. @@ -50,6 +51,6 @@ const components = { ), }; -export function CustomMDX(props: any) { +export function CustomMDX(props: any): ReactElement { return ; } diff --git a/src/app/components/navbar.tsx b/src/app/components/navbar.tsx index b996a8f..f0cdeac 100644 --- a/src/app/components/navbar.tsx +++ b/src/app/components/navbar.tsx @@ -8,7 +8,7 @@ import Logo from "./logo"; import { ToggleThemeButton } from "./theme-toggle-button"; import { GithubStar } from "@/app/components/github-star"; import { Card } from "@/app/components/card"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; type Page = { /** diff --git a/src/app/components/player/lookup-player.tsx b/src/app/components/player/lookup-player.tsx index acb3077..65a7817 100644 --- a/src/app/components/player/lookup-player.tsx +++ b/src/app/components/player/lookup-player.tsx @@ -1,6 +1,6 @@ "use client"; -import { useToast } from "@/common/use-toast"; +import { useToast } from "@/app/common/use-toast"; import { getPlayer } from "mcutils-library"; import { useRouter } from "next/navigation"; import { ReactElement, useState } from "react"; diff --git a/src/app/components/player/skin-part-image.tsx b/src/app/components/player/skin-part-image.tsx index 7b771fd..0e763e5 100644 --- a/src/app/components/player/skin-part-image.tsx +++ b/src/app/components/player/skin-part-image.tsx @@ -1,5 +1,5 @@ /* eslint-disable @next/next/no-img-element */ -import { capitalizeFirstLetter } from "@/common/string-utils"; +import { capitalizeFirstLetter } from "@/app/common/string-utils"; import { SkinPart } from "mcutils-library"; import Link from "next/link"; import { ReactElement } from "react"; diff --git a/src/app/components/server/lookup-server.tsx b/src/app/components/server/lookup-server.tsx index 3ceefca..ce8ad89 100644 --- a/src/app/components/server/lookup-server.tsx +++ b/src/app/components/server/lookup-server.tsx @@ -1,7 +1,7 @@ "use client"; -import { capitalizeFirstLetter } from "@/common/string-utils"; -import { useToast } from "@/common/use-toast"; +import { capitalizeFirstLetter } from "@/app/common/string-utils"; +import { useToast } from "@/app/common/use-toast"; import { getServer, ServerPlatform } from "mcutils-library"; import { useRouter } from "next/navigation"; import { ReactElement, useState } from "react"; diff --git a/src/app/components/server/server-view.tsx b/src/app/components/server/server-view.tsx index eef1c12..82b7f26 100644 --- a/src/app/components/server/server-view.tsx +++ b/src/app/components/server/server-view.tsx @@ -4,7 +4,7 @@ import { ReactElement } from "react"; import { CodeDialog } from "../code-dialog"; import { Button } from "../ui/button"; import config from "@root/config.json"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; import { minecraft } from "@/app/font/fonts"; import { CacheInformation } from "@/app/components/cache-information"; diff --git a/src/app/components/ui/button.tsx b/src/app/components/ui/button.tsx index 3247b0b..b2e91d1 100644 --- a/src/app/components/ui/button.tsx +++ b/src/app/components/ui/button.tsx @@ -2,7 +2,7 @@ import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; import * as React from "react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", diff --git a/src/app/components/ui/card.tsx b/src/app/components/ui/card.tsx index 1cfea2e..19d8fda 100644 --- a/src/app/components/ui/card.tsx +++ b/src/app/components/ui/card.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const Card = React.forwardRef>(({ className, ...props }, ref) => (
diff --git a/src/app/components/ui/context-menu.tsx b/src/app/components/ui/context-menu.tsx index d4b47b0..73e7e47 100644 --- a/src/app/components/ui/context-menu.tsx +++ b/src/app/components/ui/context-menu.tsx @@ -4,7 +4,7 @@ import * as React from "react"; import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const ContextMenu = ContextMenuPrimitive.Root; diff --git a/src/app/components/ui/dialog.tsx b/src/app/components/ui/dialog.tsx index 3b2349a..347ab98 100644 --- a/src/app/components/ui/dialog.tsx +++ b/src/app/components/ui/dialog.tsx @@ -4,7 +4,7 @@ import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; import * as React from "react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const Dialog = DialogPrimitive.Root; diff --git a/src/app/components/ui/input.tsx b/src/app/components/ui/input.tsx index 9e5f24a..4bcc2b8 100644 --- a/src/app/components/ui/input.tsx +++ b/src/app/components/ui/input.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; export interface InputProps extends React.InputHTMLAttributes {} diff --git a/src/app/components/ui/label.tsx b/src/app/components/ui/label.tsx index bd524b4..77ab571 100644 --- a/src/app/components/ui/label.tsx +++ b/src/app/components/ui/label.tsx @@ -4,7 +4,7 @@ import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"); diff --git a/src/app/components/ui/popover.tsx b/src/app/components/ui/popover.tsx index 66c01bc..c4e1d06 100644 --- a/src/app/components/ui/popover.tsx +++ b/src/app/components/ui/popover.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import * as PopoverPrimitive from "@radix-ui/react-popover"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const Popover = PopoverPrimitive.Root; diff --git a/src/app/components/ui/select.tsx b/src/app/components/ui/select.tsx index 6e2fad2..0f8b4b3 100644 --- a/src/app/components/ui/select.tsx +++ b/src/app/components/ui/select.tsx @@ -4,7 +4,7 @@ import * as React from "react"; import * as SelectPrimitive from "@radix-ui/react-select"; import { Check, ChevronDown, ChevronUp } from "lucide-react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const Select = SelectPrimitive.Root; diff --git a/src/app/components/ui/separator.tsx b/src/app/components/ui/separator.tsx index 313bc21..a7ad2c0 100644 --- a/src/app/components/ui/separator.tsx +++ b/src/app/components/ui/separator.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import * as SeparatorPrimitive from "@radix-ui/react-separator"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const Separator = React.forwardRef< React.ElementRef, diff --git a/src/app/components/ui/table.tsx b/src/app/components/ui/table.tsx index 80365c4..91f8302 100644 --- a/src/app/components/ui/table.tsx +++ b/src/app/components/ui/table.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; import * as React from "react"; const Table = React.forwardRef>( diff --git a/src/app/components/ui/toast.tsx b/src/app/components/ui/toast.tsx index c478eee..e27b6cf 100644 --- a/src/app/components/ui/toast.tsx +++ b/src/app/components/ui/toast.tsx @@ -5,7 +5,7 @@ import * as ToastPrimitives from "@radix-ui/react-toast"; import { cva, type VariantProps } from "class-variance-authority"; import { X } from "lucide-react"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const ToastProvider = ToastPrimitives.Provider; diff --git a/src/app/components/ui/toaster.tsx b/src/app/components/ui/toaster.tsx index 4f84660..0e07b2f 100644 --- a/src/app/components/ui/toaster.tsx +++ b/src/app/components/ui/toaster.tsx @@ -8,7 +8,7 @@ import { ToastTitle, ToastViewport, } from "@/app/components/ui/toast"; -import { useToast } from "@/common/use-toast"; +import { useToast } from "@/app/common/use-toast"; export function Toaster() { const { toasts } = useToast(); diff --git a/src/app/components/ui/tooltip.tsx b/src/app/components/ui/tooltip.tsx index 0572307..4108806 100644 --- a/src/app/components/ui/tooltip.tsx +++ b/src/app/components/ui/tooltip.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { cn } from "@/common/utils"; +import { cn } from "@/app/common/utils"; const TooltipProvider = TooltipPrimitive.Provider;