mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-11-12 07:59:17 +00:00
chore: update packages
This commit is contained in:
parent
59866a00a5
commit
f0cf08f2a4
6 changed files with 1029 additions and 717 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "@tomodachi-share/backend",
|
"name": "@tomodachi-share/backend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@11.24.0",
|
"packageManager": "pnpm@12.14.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
|
@ -19,30 +19,30 @@
|
||||||
"charinfo-ex": "^0.0.5",
|
"charinfo-ex": "^0.0.5",
|
||||||
"dayjs": "^1.11.23",
|
"dayjs": "^1.11.23",
|
||||||
"downshift": "^9.4.0",
|
"downshift": "^9.4.0",
|
||||||
"file-type": "^22.0.2",
|
"file-type": "^22.2.0",
|
||||||
"next": "16.3.3",
|
"next": "16.4.2",
|
||||||
"next-auth": "5.0.0-beta.32",
|
"next-auth": "5.0.0-beta.32",
|
||||||
"qrcode-generator": "^2.0.4",
|
"qrcode-generator": "^2.0.4",
|
||||||
"react": "^19.2.8",
|
"react": "^19.3.1",
|
||||||
"react-dom": "^19.2.8",
|
"react-dom": "^19.3.1",
|
||||||
"redis": "^6.2.1",
|
"redis": "^6.3.0",
|
||||||
"satori": "^0.33.4",
|
"satori": "0.33.4",
|
||||||
"sharp": "^0.34.5",
|
"sharp": "^0.34.5",
|
||||||
"sjcl-with-all": "1.0.8",
|
"sjcl-with-all": "1.0.8",
|
||||||
"zod": "^4.5.4"
|
"zod": "^4.6.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.3.6",
|
"@eslint/eslintrc": "^3.3.7",
|
||||||
"@iconify/react": "^6.0.2",
|
"@iconify/react": "^6.0.3",
|
||||||
"@tailwindcss/postcss": "^4.3.3",
|
"@tailwindcss/postcss": "^4.3.3",
|
||||||
"@types/node": "^26.4.0",
|
"@types/node": "^26.6.5",
|
||||||
"@types/react": "^19.2.18",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.2.5",
|
"@types/react-dom": "^19.3.0",
|
||||||
"@types/sjcl": "^1.0.34",
|
"@types/sjcl": "^1.0.34",
|
||||||
"eslint": "^10.9.1",
|
"eslint": "^10.13.0",
|
||||||
"eslint-config-next": "16.3.3",
|
"eslint-config-next": "16.4.2",
|
||||||
"prisma": "^6.19.3",
|
"prisma": "^6.19.3",
|
||||||
"schema-dts": "^2.0.0",
|
"schema-dts": "^2.1.0",
|
||||||
"tailwindcss": "^4.3.3",
|
"tailwindcss": "^4.3.3",
|
||||||
"typescript": "^7.0.2"
|
"typescript": "^7.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ const fontCache: Record<string, Font | null> = {
|
||||||
extraBold: null,
|
extraBold: null,
|
||||||
black: null,
|
black: null,
|
||||||
};
|
};
|
||||||
|
let logoCache: string | null = null;
|
||||||
|
|
||||||
// Load fonts only once and cache them
|
// Load fonts only once and cache them
|
||||||
const loadFonts = async (): Promise<Font[]> => {
|
const loadFonts = async (): Promise<Font[]> => {
|
||||||
|
|
@ -98,11 +99,20 @@ const loadFonts = async (): Promise<Font[]> => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Load logo only once and cache them
|
||||||
|
const loadLogo = async (): Promise<string> => {
|
||||||
|
if (!logoCache) {
|
||||||
|
const data = await fs.readFile(path.join(process.cwd(), "public/logo.svg"));
|
||||||
|
logoCache = `data:image/svg+xml;base64,${data.toString("base64")}`;
|
||||||
|
}
|
||||||
|
return logoCache;
|
||||||
|
};
|
||||||
|
|
||||||
export async function generateMetadataImage(mii: Mii, author: string): Promise<{ buffer?: Buffer; error?: string; status?: number }> {
|
export async function generateMetadataImage(mii: Mii, author: string): Promise<{ buffer?: Buffer; error?: string; status?: number }> {
|
||||||
const miiUploadsDirectory = path.join(uploadsDirectory, mii.id.toString());
|
const miiUploadsDirectory = path.join(uploadsDirectory, mii.id.toString());
|
||||||
|
|
||||||
// Load assets concurrently
|
// Load assets concurrently
|
||||||
const [miiImage, qrCodeImage, fonts] = await Promise.all([
|
const [miiImage, qrCodeImage, fonts, logoImage] = await Promise.all([
|
||||||
// Read and convert the images to data URI
|
// Read and convert the images to data URI
|
||||||
fs.readFile(path.join(miiUploadsDirectory, "mii.png")).then((buffer) =>
|
fs.readFile(path.join(miiUploadsDirectory, "mii.png")).then((buffer) =>
|
||||||
sharp(buffer)
|
sharp(buffer)
|
||||||
|
|
@ -123,6 +133,7 @@ export async function generateMetadataImage(mii: Mii, author: string): Promise<{
|
||||||
)
|
)
|
||||||
: Promise.resolve(null),
|
: Promise.resolve(null),
|
||||||
loadFonts(),
|
loadFonts(),
|
||||||
|
loadLogo(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const jsx: ReactNode = (
|
const jsx: ReactNode = (
|
||||||
|
|
@ -132,7 +143,7 @@ export async function generateMetadataImage(mii: Mii, author: string): Promise<{
|
||||||
<div
|
<div
|
||||||
tw={`h-62 rounded-xl flex justify-center items-center mr-2 ${mii.platform === "THREE_DS" ? "w-80" : "w-100"}`}
|
tw={`h-62 rounded-xl flex justify-center items-center mr-2 ${mii.platform === "THREE_DS" ? "w-80" : "w-100"}`}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: "linear-gradient(to bottom, #fef3c7, #fde68a);",
|
backgroundImage: "linear-gradient(to bottom, #fef3c7, #fde68a)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|
@ -177,7 +188,7 @@ export async function generateMetadataImage(mii: Mii, author: string): Promise<{
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div tw="absolute inset-0" style={{ position: "absolute", backgroundImage: "linear-gradient(to right, #fffbeb00 70%, #fffbeb);" }}></div>
|
<div tw="absolute inset-0" style={{ position: "absolute", backgroundImage: "linear-gradient(to right, #fffbeb00 70%, #fffbeb)" }}></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Author */}
|
{/* Author */}
|
||||||
|
|
@ -190,7 +201,7 @@ export async function generateMetadataImage(mii: Mii, author: string): Promise<{
|
||||||
|
|
||||||
{/* Watermark */}
|
{/* Watermark */}
|
||||||
<div tw="absolute bottom-0 right-0 flex items-center">
|
<div tw="absolute bottom-0 right-0 flex items-center">
|
||||||
<img src={`${process.env.NEXT_PUBLIC_FRONTEND_URL}/logo.svg`} height={32} />
|
<img src={logoImage} height={32} />
|
||||||
{/* I tried using text-orange-400 but it wasn't correct..? */}
|
{/* I tried using text-orange-400 but it wasn't correct..? */}
|
||||||
<span tw="ml-2 font-black text-xl" style={{ color: "#FF8904" }}>
|
<span tw="ml-2 font-black text-xl" style={{ color: "#FF8904" }}>
|
||||||
TomodachiShare
|
TomodachiShare
|
||||||
|
|
|
||||||
|
|
@ -13,41 +13,41 @@
|
||||||
"@bprogress/react": "^1.2.7",
|
"@bprogress/react": "^1.2.7",
|
||||||
"@fontsource-variable/lexend": "^5.3.0",
|
"@fontsource-variable/lexend": "^5.3.0",
|
||||||
"@hello-pangea/dnd": "^18.0.1",
|
"@hello-pangea/dnd": "^18.0.1",
|
||||||
"@nanostores/react": "^1.1.0",
|
"@nanostores/react": "^2.0.1",
|
||||||
"@tailwindcss/vite": "^4.3.3",
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
"@tomodachi-share/shared": "workspace:*",
|
"@tomodachi-share/shared": "workspace:*",
|
||||||
"@types/react": "^19.2.18",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.2.5",
|
"@types/react-dom": "^19.3.0",
|
||||||
"canvas-confetti": "^1.9.4",
|
"canvas-confetti": "^1.9.4",
|
||||||
"dayjs": "^1.11.23",
|
"dayjs": "^1.11.23",
|
||||||
"downshift": "^9.4.0",
|
"downshift": "^9.4.0",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"embla-carousel-react": "^8.6.0",
|
||||||
"jsqr": "^1.4.0",
|
"jsqr": "^1.4.0",
|
||||||
"nanostores": "^1.5.2",
|
"nanostores": "^1.5.5",
|
||||||
"qrcode-generator": "^2.0.4",
|
"qrcode-generator": "^2.0.4",
|
||||||
"react": "^19.2.8",
|
"react": "^19.3.1",
|
||||||
"react-dom": "^19.2.8",
|
"react-dom": "^19.3.1",
|
||||||
"react-dropzone": "^20.1.1",
|
"react-dropzone": "^20.1.4",
|
||||||
"react-image-crop": "^11.1.2",
|
"react-image-crop": "^11.1.2",
|
||||||
"react-router": "^8.3.1",
|
"react-router": "^8.5.0",
|
||||||
"tailwindcss": "^4.3.3",
|
"tailwindcss": "^4.3.3",
|
||||||
"vite-plugin-node-polyfills": "^0.28.0",
|
"vite-plugin-node-polyfills": "^0.28.0",
|
||||||
"zod": "^4.5.4"
|
"zod": "^4.6.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@iconify/react": "^6.0.2",
|
"@iconify/react": "^6.0.3",
|
||||||
"@types/canvas-confetti": "^1.9.0",
|
"@types/canvas-confetti": "^1.9.0",
|
||||||
"@types/node": "^26.4.0",
|
"@types/node": "^26.6.5",
|
||||||
"@types/react": "^19.2.18",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.2.5",
|
"@types/react-dom": "^19.3.0",
|
||||||
"@vitejs/plugin-react": "^6.1.1",
|
"@vitejs/plugin-react": "^6.1.2",
|
||||||
"eslint": "^10.9.1",
|
"eslint": "^10.13.0",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.5",
|
"eslint-plugin-react-refresh": "^0.5.7",
|
||||||
"globals": "^17.11.0",
|
"globals": "^17.13.0",
|
||||||
"typescript": "~7.0.2",
|
"typescript": "~7.0.2",
|
||||||
"typescript-eslint": "^8.68.0",
|
"typescript-eslint": "^8.72.0",
|
||||||
"vite": "^8.2.2"
|
"vite": "^8.3.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,5 @@
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"packageManager": "pnpm@11.24.0"
|
"packageManager": "pnpm@12.14.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1654
pnpm-lock.yaml
generated
1654
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -18,3 +18,4 @@ minimumReleaseAgeExclude:
|
||||||
- '@redis/time-series@6.2.0'
|
- '@redis/time-series@6.2.0'
|
||||||
- redis@6.2.0
|
- redis@6.2.0
|
||||||
- zod@4.5.4
|
- zod@4.5.4
|
||||||
|
- satori@0.63.2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue