Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
danreeves committed Nov 12, 2023
1 parent ce3adad commit 7923f8c
Show file tree
Hide file tree
Showing 37 changed files with 4,690 additions and 5,597 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ STEAM_API_KEY=
SECRETSECRET=
# Planetscale DB URL
DATABASE_URL=
# The default Steam ID to use the auth token for public pages like the mission board
# A default Steam ID to use the auth token for public pages like the mission board
DEFAULT_STEAM_ID=
4 changes: 2 additions & 2 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LinksFunction, LoaderArgs } from "@remix-run/node"
import type { LinksFunction, LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import {
Links,
Expand Down Expand Up @@ -60,7 +60,7 @@ function getLocale(request: Request): string {
return `${firstLang.code}-${firstLang.region.toLowerCase()}`
}

export let loader = async ({ request }: LoaderArgs) => {
export let loader = async ({ request }: LoaderFunctionArgs) => {
const user = await authenticator.isAuthenticated(request)
const locale = getLocale(request)

Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.blessings.$blessing.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { useLoaderData } from "@remix-run/react"
import { Img } from "~/components/Img"
import { getItem } from "~/data/items.server"
import { BlessingSchema } from "~/data/schemas.server"

export const loader = async ({ params }: LoaderArgs) => {
export const loader = async ({ params }: LoaderFunctionArgs) => {
let item = await getItem(BlessingSchema, params.blessing || "NO PARAM?")
if (!item) {
throw new Response("Not Found", {
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.curios.$curio.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { useLoaderData } from "@remix-run/react"
import { Img } from "~/components/Img"
import { getItem } from "~/data/items.server"
import { CurioSchema } from "~/data/schemas.server"

export const loader = async ({ params }: LoaderArgs) => {
export const loader = async ({ params }: LoaderFunctionArgs) => {
let item = await getItem(CurioSchema, params.curio || "NO PARAM?")
if (!item) {
throw new Response("Not Found", {
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.skins.$skin.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { useLoaderData } from "@remix-run/react"
import { Img } from "~/components/Img"
import { getItem } from "~/data/items.server"
import { SkinSchema } from "~/data/schemas.server"

export const loader = async ({ params }: LoaderArgs) => {
export const loader = async ({ params }: LoaderFunctionArgs) => {
let item = await getItem(SkinSchema, params.skin || "NO PARAM?")
if (!item) {
throw new Response("Not Found", {
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.skins.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json } from "@remix-run/node"
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { Link, useLoaderData, useOutlet } from "@remix-run/react"
import { Form } from "~/components/Form"
import { getItems } from "~/data/items.server"
Expand All @@ -10,7 +10,7 @@ import { Input } from "~/components/ui/input"
import { Checkbox } from "~/components/ui/checkbox"
import { Button } from "~/components/ui/button"

export const loader = async ({ request }: LoaderArgs) => {
export const loader = async ({ request }: LoaderFunctionArgs) => {
const url = new URL(request.url)
const name = url.searchParams.get("name") ?? undefined
const showDescriptions = url.searchParams.has("descriptions")
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.weapons.$weapon.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { useLoaderData } from "@remix-run/react"
import { getItem } from "~/data/items.server"
import { WeaponSchema } from "~/data/schemas.server"

export const loader = async ({ params }: LoaderArgs) => {
export const loader = async ({ params }: LoaderFunctionArgs) => {
let weapon = await getItem(WeaponSchema, params.weapon || "NO WEAPON PARAM?")
if (!weapon) {
throw new Response("Not Found", {
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.codex.weapons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { Link, useLoaderData, useOutlet } from "@remix-run/react"
import { TagList } from "~/components/TagList"
Expand All @@ -13,7 +13,7 @@ import { Checkbox } from "~/components/ui/checkbox"
import { titleCase } from "~/utils/titleCase"
import { Button } from "~/components/ui/button"

export const loader = async ({ request }: LoaderArgs) => {
export const loader = async ({ request }: LoaderFunctionArgs) => {
const url = new URL(request.url)
const item_type = getSearchParam(url.searchParams, "type", [
"melee",
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_pages.logout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LoaderArgs } from "@remix-run/node"
import type { LoaderFunctionArgs } from "@remix-run/node"
import { authenticator } from "~/services/auth.server"

export let loader = async ({ request }: LoaderArgs) => {
export let loader = async ({ request }: LoaderFunctionArgs) => {
await authenticator.logout(request, { redirectTo: "/" })
}
6 changes: 3 additions & 3 deletions app/routes/_pages.settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionArgs, LoaderArgs } from "@remix-run/node"
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { deleteAuthToken, getAuthToken } from "~/services/db/authtoken.server"
import { authenticator } from "~/services/auth.server"
Expand All @@ -7,7 +7,7 @@ import { Form, useLoaderData } from "@remix-run/react"
import { TrashIcon } from "@heroicons/react/24/outline"
import { Button } from "~/components/ui/button"

export async function loader({ request }: LoaderArgs) {
export async function loader({ request }: LoaderFunctionArgs) {
let user = await authenticator.isAuthenticated(request, {
failureRedirect: "/login",
})
Expand All @@ -24,7 +24,7 @@ export async function loader({ request }: LoaderArgs) {
return json({ title: "Settings", hasAuthToken })
}

export async function action({ request }: ActionArgs) {
export async function action({ request }: ActionFunctionArgs) {
let user = await authenticator.isAuthenticated(request, {
failureRedirect: "/login",
})
Expand Down
25 changes: 14 additions & 11 deletions app/routes/_pages.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
import { Link, Outlet, useMatches } from "@remix-run/react"
import { uniqBy } from "lodash-es"
import { object, optional, string, parse } from "valibot"

let PageData = object({
title: optional(string()),
})

export default function PageLayout() {
const matches = useMatches()

let currentPage = matches.at(-1) ?? { data: { title: "Home" } }
let currentPageData = parse(PageData, currentPage.data)

return (
<div className="h-full w-full overflow-scroll pb-16">
<header className="bg-background ">
<Title title={matches.at(-1)?.data?.title} />
<Title title={currentPageData.title} />
<Breadcrumbs
crumbs={uniqBy(matches, (match) => {
return match.pathname.replace(/\/$/, "")
}).map((match) => {
let pageData = parse(PageData, match.data)
return {
to: match.pathname,
label: match.data?.title || "Home",
label: pageData.title || "Home",
}
})}
/>
Expand Down Expand Up @@ -67,15 +76,9 @@ function Breadcrumbs({ crumbs }: { crumbs: { to: string; label: string }[] }) {
)
}

function Breadcrumb({
to,
label,
last,
}: {
to: string
label: string
last?: boolean
}) {
function Breadcrumb(
{ to, label, last }: { to: string; label: string; last?: boolean },
) {
return (
<li className="flex items-center">
<Link
Expand Down
8 changes: 4 additions & 4 deletions app/routes/api.event.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ActionArgs } from "@remix-run/node"
import type { ActionFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { getClientIPAddress } from "remix-utils"
import { getClientIPAddress } from "remix-utils/get-client-ip-address"

export async function action({ request }: ActionArgs) {
export async function action({ request }: ActionFunctionArgs) {
try {
const { origin } = new URL(request.url)
const analyticsHost = "https://plausible.io"
Expand Down Expand Up @@ -44,5 +44,5 @@ export async function loader() {
throw new Response(null, {
status: 404,
statusText: "Not Found",
});
})
}
4 changes: 2 additions & 2 deletions app/routes/api.gameplay_session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionArgs } from "@remix-run/server-runtime"
import type { ActionFunctionArgs } from "@remix-run/server-runtime"
import { json } from "@remix-run/server-runtime"
import { z } from "zod"
import { saveGameplaySession } from "~/services/db/gameplaySessions.server"
Expand All @@ -9,7 +9,7 @@ let GameplaySessionSchema = z.object({
session_id: z.string(),
})

export async function action({ request }: ActionArgs) {
export async function action({ request }: ActionFunctionArgs) {
let body = await request.json()
let { account_id, character_id, session_id } =
GameplaySessionSchema.parse(body)
Expand Down
6 changes: 3 additions & 3 deletions app/routes/armoury.$character.$store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
useLoaderData,
useNavigation,
} from "@remix-run/react"
import type { ActionArgs, LoaderArgs } from "@remix-run/node"
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node"
import { redirect, json } from "@remix-run/node"
import { z } from "zod"
import { zx } from "zodix"
Expand Down Expand Up @@ -45,7 +45,7 @@ let storeSlugToType: Record<string, "credits" | "marks"> = {
requisitorium: "marks",
}

export async function action({ params, request }: ActionArgs) {
export async function action({ params, request }: ActionFunctionArgs) {
let { character: characterId, store: storeSlug } = zx.parseParams(params, {
character: z.string(),
store: z.string(),
Expand Down Expand Up @@ -117,7 +117,7 @@ let sort = function (a: number, b: number) {

let EMPTY_RESULT = { offers: [], wallet: undefined }

export async function loader({ request, params }: LoaderArgs) {
export async function loader({ request, params }: LoaderFunctionArgs) {
let { character, store } = zx.parseParams(params, {
character: z.string(),
store: z.string(),
Expand Down
6 changes: 3 additions & 3 deletions app/routes/armoury.$character.contracts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CircleStackIcon, Square2StackIcon } from "@heroicons/react/24/outline"
import { Form, useLoaderData, useNavigation } from "@remix-run/react"
import type { ActionArgs, LoaderArgs } from "@remix-run/node"
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node"
import { json } from "@remix-run/node"
import { useEffect, useState } from "react"
import { z } from "zod"
Expand All @@ -16,7 +16,7 @@ import {
import { twMerge } from "tailwind-merge"
import useLocale from "~/hooks/locale"

export async function action({ params, request }: ActionArgs) {
export async function action({ params, request }: ActionFunctionArgs) {
let { character: characterId } = zx.parseParams(params, {
character: z.string(),
})
Expand Down Expand Up @@ -67,7 +67,7 @@ function criteriaToDescription(criteria) {
}
}

export async function loader({ params, request }: LoaderArgs) {
export async function loader({ params, request }: LoaderFunctionArgs) {
let { character: characterId } = zx.parseParams(params, {
character: z.string(),
})
Expand Down
4 changes: 2 additions & 2 deletions app/routes/armoury.$character.inventory.$item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import { useLoaderData, useLocation } from "@remix-run/react"
// import type { LoaderArgs } from "@remix-run/node"
// import type { LoaderFunctionArgs } from "@remix-run/node"
// import { redirect, json } from "@remix-run/node"
// import { z } from "zod"
// import { zx } from "zodix"
Expand All @@ -15,7 +15,7 @@
// import { getWeaponTemplate } from "~/data/weaponTemplates.server"
// import { twMerge } from "tailwind-merge"

// export async function loader({ request, params }: LoaderArgs) {
// export async function loader({ request, params }: LoaderFunctionArgs) {
// let { character: characterId, item: itemId } = zx.parseParams(params, {
// character: z.string(),
// item: z.string(),
Expand Down
4 changes: 2 additions & 2 deletions app/routes/armoury.$character.inventory.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLoaderData, useParams } from "@remix-run/react"
import type { LoaderArgs } from "@remix-run/server-runtime"
import type { LoaderFunctionArgs } from "@remix-run/server-runtime"
import { json } from "@remix-run/server-runtime"
import { z } from "zod"
import { zx } from "zodix"
Expand Down Expand Up @@ -27,7 +27,7 @@ import {
} from "~/components/ui/select"
import { uniqBy } from "lodash-es"

export async function loader({ request, params }: LoaderArgs) {
export async function loader({ request, params }: LoaderFunctionArgs) {
let { character } = zx.parseParams(params, { character: z.string() })
let url = new URL(request.url)
let filterItemTypes = getSearchParam(url.searchParams, "type", [
Expand Down
4 changes: 2 additions & 2 deletions app/routes/armoury.$character.sessions.$sessionId.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useLoaderData } from "@remix-run/react"
import type { LoaderArgs } from "@remix-run/server-runtime"
import type { LoaderFunctionArgs } from "@remix-run/server-runtime"
import { json } from "@remix-run/server-runtime"
import { z } from "zod"
import { zx } from "zodix"
import { getAuthToken } from "~/services/db/authtoken.server"
import { authenticator } from "~/services/auth.server"
import { getGameplaySession } from "~/services/db/gameplaySessions.server"

export async function loader({ params, request }: LoaderArgs) {
export async function loader({ params, request }: LoaderFunctionArgs) {
let { character: characterId, sessionId } = zx.parseParams(params, {
character: z.string(),
sessionId: z.string(),
Expand Down
4 changes: 2 additions & 2 deletions app/routes/armoury.$character.sessions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link, useLoaderData, useOutlet } from "@remix-run/react"
import type { LoaderArgs } from "@remix-run/server-runtime"
import type { LoaderFunctionArgs } from "@remix-run/server-runtime"
import { json } from "@remix-run/server-runtime"
import { z } from "zod"
import { zx } from "zodix"
Expand All @@ -16,7 +16,7 @@ import {
import { getGameplaySessions } from "~/services/db/gameplaySessions.server"
import useLocale from "~/hooks/locale"

export async function loader({ params, request }: LoaderArgs) {
export async function loader({ params, request }: LoaderFunctionArgs) {
let { character: characterId } = zx.parseParams(params, {
character: z.string(),
})
Expand Down
20 changes: 11 additions & 9 deletions app/routes/armoury.$character.statistics.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLoaderData } from "@remix-run/react"
import type { LoaderArgs } from "@remix-run/server-runtime"
import type { LoaderFunctionArgs } from "@remix-run/server-runtime"
import { json } from "@remix-run/server-runtime"
import { z } from "zod"
import { zx } from "zodix"
Expand Down Expand Up @@ -50,7 +50,7 @@ function explodeKeyTable(keyTable: unknown): Record<string, unknown>[] {
return result
}

export async function loader({ params, request }: LoaderArgs) {
export async function loader({ params, request }: LoaderFunctionArgs) {
let { character: characterId } = zx.parseParams(params, {
character: z.string(),
})
Expand Down Expand Up @@ -190,13 +190,15 @@ function StatsTable({ children }: { children: React.ReactNode }) {
)
}

function AutoTable({
rows,
cols,
}: {
rows: Record<string, unknown>[]
cols: { label: string; key: string }[]
}) {
function AutoTable(
{
rows,
cols,
}: {
rows: Record<string, unknown>[]
cols: { label: string; key: string }[]
},
) {
if (!rows.length) {
return <div className="rounded-md border ">No results</div>
}
Expand Down
Loading

0 comments on commit 7923f8c

Please sign in to comment.