diff --git a/next.config.mjs b/next.config.mjs index 400e54d..6a5c790 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -6,7 +6,7 @@ import withPlaiceholder from "@plaiceholder/next"; * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. * This is especially useful for Docker builds. */ -!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs")); +if (!process.env.SKIP_ENV_VALIDATION) await import("./src/env/server.mjs"); /** * @@ -38,7 +38,7 @@ const v2_redirects = [ return { source: url, destination: `https://undefined.behavio.rs/posts${url.slice( - nthIndex(url, "/", 4) + nthIndex(url, "/", 4), )}`, permanent: false, }; diff --git a/src/components/AppWrapper.tsx b/src/components/AppWrapper.tsx index c0d6da0..dc6150d 100644 --- a/src/components/AppWrapper.tsx +++ b/src/components/AppWrapper.tsx @@ -1,7 +1,7 @@ import type { FunctionComponent, ReactNode } from "react"; import { Disclosure } from "@headlessui/react"; import { HiBars3, HiXMark } from "react-icons/hi2"; -import { classNames } from "../utils/helpers"; +import { classNames } from "@/utils/helpers"; import Link from "next/link"; const navigation: { id: string; name: string; href: string }[] = [ diff --git a/src/components/ItemCard.tsx b/src/components/ItemCard.tsx index 2a45b7b..2bf34c0 100644 --- a/src/components/ItemCard.tsx +++ b/src/components/ItemCard.tsx @@ -1,13 +1,13 @@ import React, { useRef } from "react"; import { useOnClickOutside, useToggle } from "usehooks-ts"; -import { classNames, isHoverable } from "../utils/helpers"; -import DependentImage from "./DependentImage"; +import { classNames, isHoverable } from "@/utils/helpers"; import ReactMarkdown from "react-markdown"; import Balancer from "react-wrap-balancer"; import Link from "next/link"; import { useRouter } from "next/router"; -import { type LinkIcon, LinkIcons } from "../utils/types"; +import { type LinkIcon, LinkIcons } from "@/utils/types"; +import DependentImage from "@/components/DependentImage"; type ItemCardProps = { banner: string; @@ -31,7 +31,7 @@ const ItemCard = ({ const [active, toggleActive, setActive] = useToggle(); const router = useRouter(); - // @ts-expect-error Some kind of regression in usehooks-ts causes the useOnClickOutside hook to not accept 'null' types + // @ts-expect-error Some kind of regression in usehooks-ts causes the useOnClickOutside hook to not accept 'null' types useOnClickOutside(itemRef, (event) => { if ( mobileButtonRef.current != null && diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 33f01be..3ed3861 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,8 +1,8 @@ import { type AppType } from "next/app"; -import { trpc } from "../utils/trpc"; +import { trpc } from "@/utils/trpc"; -import "../styles/globals.scss"; +import "@/styles/globals.scss"; import { Analytics } from "@vercel/analytics/react"; import { Provider } from "react-wrap-balancer"; import Head from "next/head"; diff --git a/src/pages/api/revalidate.ts b/src/pages/api/revalidate.ts index 2284da2..6a5dd8f 100644 --- a/src/pages/api/revalidate.ts +++ b/src/pages/api/revalidate.ts @@ -1,8 +1,8 @@ import { readItem, readItems } from "@directus/sdk"; import type { NextApiRequest, NextApiResponse } from "next"; import { z } from "zod"; -import directus from "../../utils/directus"; -import { env } from "../../env/server.mjs"; +import directus from "@/utils/directus"; +import { env } from "@/env/server.mjs"; async function getURLs( type: string, diff --git a/src/pages/api/trpc/[trpc].ts b/src/pages/api/trpc/[trpc].ts index f69201d..9698f2e 100644 --- a/src/pages/api/trpc/[trpc].ts +++ b/src/pages/api/trpc/[trpc].ts @@ -1,8 +1,8 @@ import { createNextApiHandler } from "@trpc/server/adapters/next"; -import { env } from "../../../env/server.mjs"; -import { createContext } from "../../../server/trpc/context"; -import { appRouter } from "../../../server/trpc/router/_app"; +import { env } from "@/env/server.mjs"; +import { createContext } from "@/server/trpc/context"; +import { appRouter } from "@/server/trpc/router/_app"; // export API handler export default createNextApiHandler({ diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index e978158..3fba74d 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -1,5 +1,5 @@ import { type NextPage } from "next"; -import AppWrapper from "../components/AppWrapper"; +import AppWrapper from "@/components/AppWrapper"; import { BsDiscord, BsGithub } from "react-icons/bs"; import { AiFillMail } from "react-icons/ai"; import Link from "next/link"; diff --git a/src/pages/grain.tsx b/src/pages/grain.tsx index 1e36a20..72e612e 100644 --- a/src/pages/grain.tsx +++ b/src/pages/grain.tsx @@ -4,7 +4,7 @@ import Image from "next/image"; import { BsGithub } from "react-icons/bs"; import { RxOpenInNewWindow } from "react-icons/rx"; import Link from "next/link"; -import AppWrapper from "../components/AppWrapper"; +import AppWrapper from "@/components/AppWrapper"; import type { ReactNode } from "react"; type Screenshot = [string, null | string | ReactNode]; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index fb95ea7..83f11ce 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -4,11 +4,11 @@ import Head from "next/head"; import Link from "next/link"; import { useEffect } from "react"; import Balancer from "react-wrap-balancer"; -import AppWrapper from "../components/AppWrapper"; -import ItemCard from "../components/ItemCard"; -import directus from "../utils/directus"; -import { useBreakpointValue } from "../utils/helpers"; -import type { Project } from "../utils/types"; +import AppWrapper from "@/components/AppWrapper"; +import ItemCard from "@/components/ItemCard"; +import directus from "@/utils/directus"; +import { useBreakpointValue } from "@/utils/helpers"; +import type { Project } from "@/utils/types"; type IndexProps = { tagline: string; diff --git a/src/pages/paths.tsx b/src/pages/paths.tsx index 5966ed8..7399336 100644 --- a/src/pages/paths.tsx +++ b/src/pages/paths.tsx @@ -1,6 +1,6 @@ import { type NextPage } from "next"; -import AppWrapper from "../components/AppWrapper"; -import WorkInProgress from "../components/WorkInProgress"; +import AppWrapper from "@/components/AppWrapper"; +import WorkInProgress from "@/components/WorkInProgress"; const PathsPage: NextPage = () => { return ( diff --git a/src/pages/phototag.tsx b/src/pages/phototag.tsx index 5476269..f3c7b99 100644 --- a/src/pages/phototag.tsx +++ b/src/pages/phototag.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import Image from "next/image"; import { BsGithub } from "react-icons/bs"; import Link from "next/link"; -import AppWrapper from "../components/AppWrapper"; +import AppWrapper from "@/components/AppWrapper"; const PhototagPage: NextPage = () => { return ( diff --git a/src/pages/portal.tsx b/src/pages/portal.tsx index fb06c46..90787c8 100644 --- a/src/pages/portal.tsx +++ b/src/pages/portal.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import Image from "next/image"; import { BsGithub } from "react-icons/bs"; import Link from "next/link"; -import AppWrapper from "../components/AppWrapper"; +import AppWrapper from "@/components/AppWrapper"; import type { ReactNode } from "react"; const images: [string, string | ReactNode][] = [ diff --git a/src/pages/projects.tsx b/src/pages/projects.tsx index 1558212..185de07 100644 --- a/src/pages/projects.tsx +++ b/src/pages/projects.tsx @@ -1,5 +1,5 @@ import { type NextPage } from "next"; -import AppWrapper from "../components/AppWrapper"; +import AppWrapper from "@/components/AppWrapper"; import { RiMagicLine } from "react-icons/ri"; import { BiBus, BiHash, BiNetworkChart } from "react-icons/bi"; import Link from "next/link"; diff --git a/src/server/trpc/router/_app.ts b/src/server/trpc/router/_app.ts index 673135d..649fa18 100644 --- a/src/server/trpc/router/_app.ts +++ b/src/server/trpc/router/_app.ts @@ -1,5 +1,5 @@ -import { router } from "../trpc"; -import { exampleRouter } from "./example"; +import { exampleRouter } from "@/server/trpc/router/example"; +import { router } from "@/server/trpc/trpc"; export const appRouter = router({ example: exampleRouter, diff --git a/src/server/trpc/router/example.ts b/src/server/trpc/router/example.ts index 086a723..47311c9 100644 --- a/src/server/trpc/router/example.ts +++ b/src/server/trpc/router/example.ts @@ -1,6 +1,6 @@ import { z } from "zod"; -import { router, publicProcedure } from "../trpc"; +import { router, publicProcedure } from "@/server/trpc/trpc"; export const exampleRouter = router({ hello: publicProcedure diff --git a/src/server/trpc/trpc.ts b/src/server/trpc/trpc.ts index b4a9527..b9dd55e 100644 --- a/src/server/trpc/trpc.ts +++ b/src/server/trpc/trpc.ts @@ -1,8 +1,7 @@ +import { Context } from "@/server/trpc/context"; import { initTRPC } from "@trpc/server"; import superjson from "superjson"; -import { type Context } from "./context"; - const t = initTRPC.context().create({ transformer: superjson, errorFormatter({ shape }) { diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 1e79b51..482b09b 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import create from "@kodingdotninja/use-tailwind-breakpoint"; import resolveConfig from "tailwindcss/resolveConfig"; -import tailwindConfig from "./../../tailwind.config.cjs"; +import tailwindConfig from "@/../tailwind.config.cjs"; export function classNames(...classes: (string | null | undefined)[]) { return classes.filter(Boolean).join(" "); diff --git a/src/utils/trpc.ts b/src/utils/trpc.ts index 2391cbc..70aac1c 100644 --- a/src/utils/trpc.ts +++ b/src/utils/trpc.ts @@ -3,7 +3,7 @@ import { createTRPCNext } from "@trpc/next"; import { type inferRouterInputs, type inferRouterOutputs } from "@trpc/server"; import superjson from "superjson"; -import { type AppRouter } from "../server/trpc/router/_app"; +import { type AppRouter } from "@/server/trpc/router/_app"; const getBaseUrl = () => { if (typeof window !== "undefined") return ""; // browser should use relative url