fix: build errors

This commit is contained in:
trafficlunar 2026-04-17 14:35:44 +01:00
parent 1d11cf3f99
commit 8ef2b18424
11 changed files with 28 additions and 64 deletions

View file

@ -2,9 +2,6 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: "standalone", output: "standalone",
images: {
unoptimized: true,
},
async headers() { async headers() {
return [ return [
{ {

View file

@ -36,7 +36,9 @@
"sharp": "^0.34.5", "sharp": "^0.34.5",
"sjcl-with-all": "1.0.8", "sjcl-with-all": "1.0.8",
"swr": "^2.4.1", "swr": "^2.4.1",
"zod": "^4.3.6" "zod": "^4.3.6",
"@tomodachi-share/shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.3.5", "@eslint/eslintrc": "^3.3.5",
@ -53,8 +55,7 @@
"prisma": "^6.19.2", "prisma": "^6.19.2",
"schema-dts": "^2.0.0", "schema-dts": "^2.0.0",
"tailwindcss": "^4.2.2", "tailwindcss": "^4.2.2",
"typescript": "^6.0.2", "typescript": "^6.0.2"
"@tomodachi-share/shared": "workspace:*"
}, },
"exports": { "exports": {
".": "./src/types.d.ts" ".": "./src/types.d.ts"

View file

@ -1,50 +0,0 @@
import { Metadata } from "next";
import { redirect } from "next/navigation";
import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import EditForm from "@/components/submit-form/edit-form";
interface Props {
params: Promise<{ id: string }>;
}
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
const mii = await prisma.mii.findUnique({
where: {
id: Number(id),
},
});
return {
title: `${mii?.name} - TomodachiShare`,
description: `Edit the name, tags, and images of '${mii?.name}'`,
robots: {
index: false,
follow: false,
},
};
}
export default async function MiiPage({ params }: Props) {
const { id } = await params;
const session = await auth();
const mii = await prisma.mii.findUnique({
where: {
id: Number(id),
},
include: {
_count: {
select: { likedBy: true }, // Get total like count
},
},
});
// Check ownership
if (!mii || (Number(session?.user?.id) !== mii.userId && Number(session?.user?.id) !== Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID))) redirect("/404");
return <EditForm mii={mii} likes={mii._count.likedBy} />;
}

View file

@ -1,3 +1,5 @@
"use client";
import { useState } from "react"; import { useState } from "react";
import ReasonSelector from "./reason-selector"; import ReasonSelector from "./reason-selector";

View file

@ -1,3 +1,5 @@
"use client";
import { Icon } from "@iconify/react"; import { Icon } from "@iconify/react";
import { ReportReason } from "@prisma/client"; import { ReportReason } from "@prisma/client";
import { useSelect } from "downshift"; import { useSelect } from "downshift";

View file

@ -1,9 +1,11 @@
"use client";
import { useState } from "react"; import { useState } from "react";
import ReasonSelector from "./reason-selector"; import ReasonSelector from "./reason-selector";
import SubmitButton from "../submit-button"; import SubmitButton from "../submit-button";
import { ReportReason } from "@prisma/client"; import { ReportReason, User } from "@prisma/client";
import { User } from "next-auth"; import Image from "next/image";
interface Props { interface Props {
user: User; user: User;
@ -39,7 +41,13 @@ export default function ReportUserForm({ user }: Props) {
<hr className="border-zinc-300" /> <hr className="border-zinc-300" />
<div className="bg-orange-100 rounded-xl border-2 border-orange-400 flex p-4 gap-4"> <div className="bg-orange-100 rounded-xl border-2 border-orange-400 flex p-4 gap-4">
<image src={user.image ?? "/guest.png"} width={96} height={96} className="aspect-square rounded-full border-2 border-orange-400" /> <Image
src={user.image ?? "/guest.png"}
alt="profile picture"
width={96}
height={96}
className="aspect-square rounded-full border-2 border-orange-400"
/>
<p className="text-xl font-bold overflow-hidden text-ellipsis">{user.name}</p> <p className="text-xl font-bold overflow-hidden text-ellipsis">{user.name}</p>
</div> </div>

View file

@ -1,3 +1,5 @@
"use client";
import { useState } from "react"; import { useState } from "react";
import { Icon } from "@iconify/react"; import { Icon } from "@iconify/react";

View file

@ -2,7 +2,6 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TomodachiShare</title> <title>TomodachiShare</title>
<meta name="description" content="Discover and share Mii residents for your Tomodachi Life island!" /> <meta name="description" content="Discover and share Mii residents for your Tomodachi Life island!" />

View file

@ -25,6 +25,9 @@ importers:
'@prisma/client': '@prisma/client':
specifier: ^6.19.2 specifier: ^6.19.2
version: 6.19.3(prisma@6.19.3(typescript@6.0.2))(typescript@6.0.2) version: 6.19.3(prisma@6.19.3(typescript@6.0.2))(typescript@6.0.2)
'@tomodachi-share/shared':
specifier: workspace:*
version: link:../shared
bit-buffer: bit-buffer:
specifier: ^0.3.0 specifier: ^0.3.0
version: 0.3.0 version: 0.3.0
@ -98,9 +101,6 @@ importers:
'@tailwindcss/postcss': '@tailwindcss/postcss':
specifier: ^4.2.2 specifier: ^4.2.2
version: 4.2.2 version: 4.2.2
'@tomodachi-share/shared':
specifier: workspace:*
version: link:../shared
'@types/canvas-confetti': '@types/canvas-confetti':
specifier: ^1.9.0 specifier: ^1.9.0
version: 1.9.0 version: 1.9.0

View file

@ -19,7 +19,9 @@ import { ThreeDsTomodachiLifeMii, HairDyeMode } from "./three-ds-tomodachi-life-
/** Private _ctrMode function defined here: {@link https://github.com/bitwiseshiftleft/sjcl/blob/85caa53c281eeeb502310013312c775d35fe0867/core/ccm.js#L194} */ /** Private _ctrMode function defined here: {@link https://github.com/bitwiseshiftleft/sjcl/blob/85caa53c281eeeb502310013312c775d35fe0867/core/ccm.js#L194} */
const sjclCcmCtrMode: const sjclCcmCtrMode:
| ((prf: sjcl.SjclCipher, data: sjcl.BitArray, iv: sjcl.BitArray, tag: sjcl.BitArray, tlen: number, L: number) => { data: sjcl.BitArray; tag: sjcl.BitArray }) | ((prf: sjcl.SjclCipher, data: sjcl.BitArray, iv: sjcl.BitArray, tag: sjcl.BitArray, tlen: number, L: number) => { data: sjcl.BitArray; tag: sjcl.BitArray })
| undefined = sjcl.mode.ccm.u; // NOTE: This may need to be changed with a different sjcl build. Read above | undefined =
// @ts-ignore -- Referencing a private function that is not in the types.
sjcl.mode.ccm.u; // NOTE: This may need to be changed with a different sjcl build. Read above
export function convertQrCode(bytes: Uint8Array): { mii: Mii; tomodachiLifeMii: ThreeDsTomodachiLifeMii } | never { export function convertQrCode(bytes: Uint8Array): { mii: Mii; tomodachiLifeMii: ThreeDsTomodachiLifeMii } | never {
// Decrypt 96 byte 3DS/Wii U format Mii data from the QR code. // Decrypt 96 byte 3DS/Wii U format Mii data from the QR code.

View file

@ -2,6 +2,7 @@ import { TOMODACHI_LIFE_DECRYPTION_KEY } from "./constants";
// @ts-ignore // @ts-ignore
import sjcl from "sjcl-with-all"; import sjcl from "sjcl-with-all";
// @ts-ignore - This is not in the types, but it's a function needed to enable CTR mode.
sjcl.beware["CTR mode is dangerous because it doesn't protect message integrity."](); sjcl.beware["CTR mode is dangerous because it doesn't protect message integrity."]();
// Converts hair dye to studio color // Converts hair dye to studio color