diff --git a/.env.example b/.env.example index 9299295..c736e24 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,3 @@ DATABASE_URL='mysql://root:root@mydb.com/calendrier' +NEXTAUTH_SECRET=supersecret +NEXTAUTH_URL=http://localhost:3000 \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7d4949e..667c91a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -75,7 +75,7 @@ jobs: id: build-and-push uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} + NEXT_TELEMETRY_DISABLED: 1 with: context: . push: ${{ github.event_name != 'pull_request' }} diff --git a/actions/grades.ts b/actions/grades.ts index 4d1f057..699fcf2 100644 --- a/actions/grades.ts +++ b/actions/grades.ts @@ -2,24 +2,7 @@ import prisma from "@/lib/prisma"; -export async function getGrade(testId: number, userId: number) { - const grade = await prisma.grade.findFirst({ - select: { - grade: true, - id: true, - testId: true, - createdAt: true, - }, - where: { - testId: testId, - userId: userId - } - }); - - return grade; -} - -export async function addGrade(testId: number, userId: number, grade: number, note: string | null) { +export async function addGrade(testId: number, userId: number, grade: number) { const newGrade = await prisma.grade.create({ data: { grade: grade, diff --git a/actions/mangeTest.ts b/actions/mangeTest.ts index ddc82db..cd64132 100644 --- a/actions/mangeTest.ts +++ b/actions/mangeTest.ts @@ -2,6 +2,7 @@ import prisma from "@/lib/prisma"; +// Only a test function export async function setTestActive(id: number, active: boolean) { const users = await prisma.users.findFirst(); @@ -11,7 +12,7 @@ export async function setTestActive(id: number, active: boolean) { } -export async function getActiveTest(date: Date) { +export async function getFirstActiveTest(date: Date) { return await prisma.test.findFirst({ select: { id: true, @@ -34,7 +35,7 @@ export async function getActiveTest(date: Date) { }); } -export async function getActiveTestWithGrade(date: Date, userId: number) { +export async function getFirstActiveTestWithGrade(date: Date, userId: number) { return await prisma.test.findFirst({ select: { id: true, diff --git a/actions/results.ts b/actions/results.ts index cd42c1d..b333c64 100644 --- a/actions/results.ts +++ b/actions/results.ts @@ -6,7 +6,7 @@ export interface Results { total: number; } -export async function getResults(testId: number) { +export async function getStudentResults(testId: number) { const grades = await prisma.grade.findMany({ where: { testId: testId, user: { isTeacher: false } } }); const allGrades = ['1', '1.5', '2', '2.5', '3', '3.5', '4', '4.5', '5', '5.5', '6']; diff --git a/app/page.tsx b/app/page.tsx index 05ac1f5..c1a6672 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,4 +1,4 @@ -import logo from '../images/logo.svg'; +import logo from '@/assets/images/logo.svg'; import Image from 'next/image'; import { LoginForm } from '@/components/forms/LoginForm'; import { getAuthServerSession } from '@/lib/authenticate'; diff --git a/app/play/TodayTest.tsx b/app/play/TodayTest.tsx index af33660..8f2eece 100644 --- a/app/play/TodayTest.tsx +++ b/app/play/TodayTest.tsx @@ -1,6 +1,6 @@ 'use client'; -import { getActiveTestWithGrade } from '@/actions/mangeTest'; +import { getFirstActiveTestWithGrade } from '@/actions/mangeTest'; import { TestCard } from '@/components/custom'; import { Session } from 'next-auth'; import { signOut } from 'next-auth/react'; @@ -14,7 +14,7 @@ export function TodayTest({ session }: { session: Session }) { const [activeTest, setActiveTest] = useState<{ data: any | null; error: Error | null; isLoading: boolean }>({ isLoading: true, data: null, error: null }); useEffect(() => { - getActiveTestWithGrade(new Date(), session.user.id) + getFirstActiveTestWithGrade(new Date(), session.user.id) .catch((err) => setActiveTest({ data: null, error: err, isLoading: false })) .then((data) => setActiveTest({ data, error: null, isLoading: false })); }, [session.user.id]); diff --git a/app/play/page.tsx b/app/play/page.tsx index 00cabc9..22cfb17 100644 --- a/app/play/page.tsx +++ b/app/play/page.tsx @@ -1,8 +1,8 @@ import Image from 'next/image'; -import Logo from '/images/logo.svg'; +import Logo from '@images/logo.svg'; import { getAuthServerSession } from '@/lib/authenticate'; import { redirect } from 'next/navigation'; -import { getActiveTest } from '@/actions/mangeTest'; +import { getFirstActiveTest } from '@/actions/mangeTest'; import { TodayTest } from './TodayTest'; export default async function Play() { @@ -12,24 +12,10 @@ export default async function Play() { redirect('/'); } - const now = new Date(); - const todayTest = await getActiveTest(now); - return (
{'Logo'} - {/* */} - {/* {data && data.status == 200 && password && } */} - {/*
- -
*/}
); } diff --git a/app/results/[id]/page.tsx b/app/results/[id]/page.tsx index 0920b07..9988ba2 100644 --- a/app/results/[id]/page.tsx +++ b/app/results/[id]/page.tsx @@ -3,7 +3,7 @@ import { Chart } from '@components/custom/chart'; import logo from '@images/logo.svg'; import Image from 'next/image'; import ginger from '@images/ginger.png'; -import { getResults, getTeacherResult, Results } from '@/actions/results'; +import { getStudentResults, getTeacherResult, Results } from '@/actions/results'; import { useEffect, useState } from 'react'; export default function Page({ params }: { params: { id: string } }) { @@ -17,14 +17,14 @@ export default function Page({ params }: { params: { id: string } }) { .then((res) => setTeacherGrade(res?.grade || 0)) .catch((err) => console.error(err)); - getResults(testId) + getStudentResults(testId) .then((res) => setData(res)) .catch((err) => console.error(err)); } useEffect(() => { featchResults(testId); - setTimeout(() => { + setInterval(() => { featchResults(testId); }, 5000); }, [testId]); diff --git a/images/date.svg b/assets/images/date.svg similarity index 100% rename from images/date.svg rename to assets/images/date.svg diff --git a/images/ginger.png b/assets/images/ginger.png similarity index 100% rename from images/ginger.png rename to assets/images/ginger.png diff --git a/images/logo.svg b/assets/images/logo.svg similarity index 100% rename from images/logo.svg rename to assets/images/logo.svg diff --git a/images/logout.svg b/assets/images/logout.svg similarity index 100% rename from images/logout.svg rename to assets/images/logout.svg diff --git a/images/santa/index.ts b/assets/images/santa/index.ts similarity index 100% rename from images/santa/index.ts rename to assets/images/santa/index.ts diff --git a/images/santa/santa-1.svg b/assets/images/santa/santa-1.svg similarity index 100% rename from images/santa/santa-1.svg rename to assets/images/santa/santa-1.svg diff --git a/images/santa/santa-10.svg b/assets/images/santa/santa-10.svg similarity index 100% rename from images/santa/santa-10.svg rename to assets/images/santa/santa-10.svg diff --git a/images/santa/santa-11.svg b/assets/images/santa/santa-11.svg similarity index 100% rename from images/santa/santa-11.svg rename to assets/images/santa/santa-11.svg diff --git a/images/santa/santa-12.svg b/assets/images/santa/santa-12.svg similarity index 100% rename from images/santa/santa-12.svg rename to assets/images/santa/santa-12.svg diff --git a/images/santa/santa-13.svg b/assets/images/santa/santa-13.svg similarity index 100% rename from images/santa/santa-13.svg rename to assets/images/santa/santa-13.svg diff --git a/images/santa/santa-14.svg b/assets/images/santa/santa-14.svg similarity index 100% rename from images/santa/santa-14.svg rename to assets/images/santa/santa-14.svg diff --git a/images/santa/santa-15.svg b/assets/images/santa/santa-15.svg similarity index 100% rename from images/santa/santa-15.svg rename to assets/images/santa/santa-15.svg diff --git a/images/santa/santa-16.svg b/assets/images/santa/santa-16.svg similarity index 100% rename from images/santa/santa-16.svg rename to assets/images/santa/santa-16.svg diff --git a/images/santa/santa-17.svg b/assets/images/santa/santa-17.svg similarity index 100% rename from images/santa/santa-17.svg rename to assets/images/santa/santa-17.svg diff --git a/images/santa/santa-18.svg b/assets/images/santa/santa-18.svg similarity index 100% rename from images/santa/santa-18.svg rename to assets/images/santa/santa-18.svg diff --git a/images/santa/santa-19.svg b/assets/images/santa/santa-19.svg similarity index 100% rename from images/santa/santa-19.svg rename to assets/images/santa/santa-19.svg diff --git a/images/santa/santa-2.svg b/assets/images/santa/santa-2.svg similarity index 100% rename from images/santa/santa-2.svg rename to assets/images/santa/santa-2.svg diff --git a/images/santa/santa-20.svg b/assets/images/santa/santa-20.svg similarity index 100% rename from images/santa/santa-20.svg rename to assets/images/santa/santa-20.svg diff --git a/images/santa/santa-21.svg b/assets/images/santa/santa-21.svg similarity index 100% rename from images/santa/santa-21.svg rename to assets/images/santa/santa-21.svg diff --git a/images/santa/santa-22.svg b/assets/images/santa/santa-22.svg similarity index 100% rename from images/santa/santa-22.svg rename to assets/images/santa/santa-22.svg diff --git a/images/santa/santa-23.svg b/assets/images/santa/santa-23.svg similarity index 100% rename from images/santa/santa-23.svg rename to assets/images/santa/santa-23.svg diff --git a/images/santa/santa-24.svg b/assets/images/santa/santa-24.svg similarity index 100% rename from images/santa/santa-24.svg rename to assets/images/santa/santa-24.svg diff --git a/images/santa/santa-3.svg b/assets/images/santa/santa-3.svg similarity index 100% rename from images/santa/santa-3.svg rename to assets/images/santa/santa-3.svg diff --git a/images/santa/santa-4.svg b/assets/images/santa/santa-4.svg similarity index 100% rename from images/santa/santa-4.svg rename to assets/images/santa/santa-4.svg diff --git a/images/santa/santa-5.svg b/assets/images/santa/santa-5.svg similarity index 100% rename from images/santa/santa-5.svg rename to assets/images/santa/santa-5.svg diff --git a/images/santa/santa-6.svg b/assets/images/santa/santa-6.svg similarity index 100% rename from images/santa/santa-6.svg rename to assets/images/santa/santa-6.svg diff --git a/images/santa/santa-7.svg b/assets/images/santa/santa-7.svg similarity index 100% rename from images/santa/santa-7.svg rename to assets/images/santa/santa-7.svg diff --git a/images/santa/santa-8.svg b/assets/images/santa/santa-8.svg similarity index 100% rename from images/santa/santa-8.svg rename to assets/images/santa/santa-8.svg diff --git a/images/santa/santa-9.svg b/assets/images/santa/santa-9.svg similarity index 100% rename from images/santa/santa-9.svg rename to assets/images/santa/santa-9.svg diff --git a/images/your-grade.svg b/assets/images/your-grade.svg similarity index 100% rename from images/your-grade.svg rename to assets/images/your-grade.svg diff --git a/components/custom/santa.tsx b/components/custom/santa.tsx index f9e386e..d60c8a2 100644 --- a/components/custom/santa.tsx +++ b/components/custom/santa.tsx @@ -1,17 +1,17 @@ -import Image from "next/image"; +import Image from 'next/image'; -import { santas } from "@santa/index"; +import { santas } from '@/assets/images/santa/index'; interface SantaProps { - height: number + height: number; } -export function Santa({ ...props} : SantaProps) { - if (props.height <= 0 || props.height > 24) { - return
- } - return ( -
- {"Santa"} -
- ) +export function Santa({ ...props }: SantaProps) { + if (props.height <= 0 || props.height > 24) { + return
; + } + return ( +
+ {'Santa'} +
+ ); } diff --git a/components/custom/testCard.tsx b/components/custom/testCard.tsx index 351cb22..f2f8d87 100644 --- a/components/custom/testCard.tsx +++ b/components/custom/testCard.tsx @@ -1,6 +1,6 @@ 'use client'; -import Calendar from '../../images/date.svg'; +import Calendar from '@images/date.svg'; import Image from 'next/image'; import { Ban, Snowflake, CircleOff } from 'lucide-react'; diff --git a/components/forms/GradingForm.tsx b/components/forms/GradingForm.tsx index f1d796b..54bccba 100644 --- a/components/forms/GradingForm.tsx +++ b/components/forms/GradingForm.tsx @@ -14,7 +14,7 @@ export function GradingForm({ session, testId }: { session: Session; testId: num async function handleSubmit(event: React.FormEvent) { event.preventDefault(); - const result = await addGrade(testId, session.user.id, grade, null); + const result = await addGrade(testId, session.user.id, grade); if (result.id) { console.log('ok'); setHasVoted(true); @@ -39,7 +39,7 @@ export function GradingForm({ session, testId }: { session: Session; testId: num
- setGrade(Number(e.target.value))} /> + setGrade(Number(e.target.value))} />
{YourGrade} diff --git a/package-lock.json b/package-lock.json index da01b44..7038d68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "react-chartjs-2": "^5.2.0", "react-dom": "^18", "react-timer-hook": "^3.0.7", + "sharp": "^0.33.1", "socket.io": "^4.7.2", "socket.io-client": "^4.7.2", "swr": "^2.2.4", @@ -75,6 +76,15 @@ "node": ">=6.9.0" } }, + "node_modules/@emnapi/runtime": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.44.0.tgz", + "integrity": "sha512-ZX/etZEZw8DR7zAB1eVQT40lNo0jeqpb6dCgOvctB6FIQ5PoXfMuNY8+ayQfu8tNQbAB8gQWSSJupR8NxeiZXw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -198,6 +208,437 @@ "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.1.tgz", + "integrity": "sha512-esr2BZ1x0bo+wl7Gx2hjssYhjrhUsD88VQulI0FrG8/otRQUOxLWHMBd1Y1qo2Gfg2KUvXNpT0ASnV9BzJCexw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.0" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.1.tgz", + "integrity": "sha512-YrnuB3bXuWdG+hJlXtq7C73lF8ampkhU3tMxg5Hh+E7ikxbUVOU9nlNtVTloDXz6pRHt2y2oKJq7DY/yt+UXYw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.0" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.0.tgz", + "integrity": "sha512-VzYd6OwnUR81sInf3alj1wiokY50DjsHz5bvfnsFpxs5tqQxESoHtJO6xyksDs3RIkyhMWq2FufXo6GNSU9BMw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.0.tgz", + "integrity": "sha512-dD9OznTlHD6aovRswaPNEy8dKtSAmNo4++tO7uuR4o5VxbVAOoEQ1uSmN4iFAdQneTHws1lkTZeiXPrcCkh6IA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.0.tgz", + "integrity": "sha512-VwgD2eEikDJUk09Mn9Dzi1OW2OJFRQK+XlBTkUNmAWPrtj8Ly0yq05DFgu1VCMx2/DqCGQVi5A1dM9hTmxf3uw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.0.tgz", + "integrity": "sha512-xTYThiqEZEZc0PRU90yVtM3KE7lw1bKdnDQ9kCTHWbqWyHOe4NpPOtMGy27YnN51q0J5dqRrvicfPbALIOeAZA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.0.tgz", + "integrity": "sha512-o9E46WWBC6JsBlwU4QyU9578G77HBDT1NInd+aERfxeOPbk0qBZHgoDsQmA2v9TbqJRWzoBPx1aLOhprBMgPjw==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.0.tgz", + "integrity": "sha512-naldaJy4hSVhWBgEjfdBY85CAa4UO+W1nx6a1sWStHZ7EUfNiuBTTN2KUYT5dH1+p/xij1t2QSXfCiFJoC5S/Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.0.tgz", + "integrity": "sha512-OdorplCyvmSAPsoJLldtLh3nLxRrkAAAOHsGWGDYfN0kh730gifK+UZb3dWORRa6EusNqCTjfXV4GxvgJ/nPDQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.0.tgz", + "integrity": "sha512-FW8iK6rJrg+X2jKD0Ajhjv6y74lToIBEvkZhl42nZt563FfxkCYacrXZtd+q/sRQDypQLzY5WdLkVTbJoPyqNg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.1.tgz", + "integrity": "sha512-Ii4X1vnzzI4j0+cucsrYA5ctrzU9ciXERfJR633S2r39CiD8npqH2GMj63uFZRCFt3E687IenAdbwIpQOJ5BNA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.0" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.1.tgz", + "integrity": "sha512-59B5GRO2d5N3tIfeGHAbJps7cLpuWEQv/8ySd9109ohQ3kzyCACENkFVAnGPX00HwPTQcaBNF7HQYEfZyZUFfw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.0" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.1.tgz", + "integrity": "sha512-tRGrb2pHnFUXpOAj84orYNxHADBDIr0J7rrjwQrTNMQMWA4zy3StKmMvwsI7u3dEZcgwuMMooIIGWEWOjnmG8A==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.0" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.1.tgz", + "integrity": "sha512-4y8osC0cAc1TRpy02yn5omBeloZZwS62fPZ0WUAYQiLhSFSpWJfY/gMrzKzLcHB9ulUV6ExFiu2elMaixKDbeg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.0" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.1.tgz", + "integrity": "sha512-D3lV6clkqIKUizNS8K6pkuCKNGmWoKlBGh5p0sLO2jQERzbakhu4bVX1Gz+RS4vTZBprKlWaf+/Rdp3ni2jLfA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.0" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.1.tgz", + "integrity": "sha512-LOGKNu5w8uu1evVqUAUKTix2sQu1XDRIYbsi5Q0c/SrXhvJ4QyOx+GaajxmOg5PZSsSnCYPSmhjHHsRBx06/wQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.0" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.1.tgz", + "integrity": "sha512-vWI/sA+0p+92DLkpAMb5T6I8dg4z2vzCUnp8yvxHlwBpzN8CIcO3xlSXrLltSvK6iMsVMNswAv+ub77rsf25lA==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.44.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.1.tgz", + "integrity": "sha512-/xhYkylsKL05R+NXGJc9xr2Tuw6WIVl2lubFJaFYfW4/MQ4J+dgjIo/T4qjNRizrqs/szF/lC9a5+updmY9jaQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.1.tgz", + "integrity": "sha512-XaM69X0n6kTEsp9tVYYLhXdg7Qj32vYJlAKRutxUsm1UlgQNx6BOhHwZPwukCGXBU2+tH87ip2eV1I/E8MQnZg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -1858,11 +2299,22 @@ "node": ">=6" } }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1873,8 +2325,16 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } }, "node_modules/commander": { "version": "4.1.1", @@ -2008,6 +2468,14 @@ "node": ">=6" } }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -3168,6 +3636,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "node_modules/is-async-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", @@ -4740,7 +5213,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -4780,6 +5252,45 @@ "node": ">= 0.4" } }, + "node_modules/sharp": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.1.tgz", + "integrity": "sha512-iAYUnOdTqqZDb3QjMneBKINTllCJDZ3em6WaWy7NPECM4aHncvqHRm0v0bN9nqJxMiwamv5KIdauJ6lUzKDpTQ==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "semver": "^7.5.4" + }, + "engines": { + "libvips": ">=8.15.0", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.1", + "@img/sharp-darwin-x64": "0.33.1", + "@img/sharp-libvips-darwin-arm64": "1.0.0", + "@img/sharp-libvips-darwin-x64": "1.0.0", + "@img/sharp-libvips-linux-arm": "1.0.0", + "@img/sharp-libvips-linux-arm64": "1.0.0", + "@img/sharp-libvips-linux-s390x": "1.0.0", + "@img/sharp-libvips-linux-x64": "1.0.0", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.0", + "@img/sharp-libvips-linuxmusl-x64": "1.0.0", + "@img/sharp-linux-arm": "0.33.1", + "@img/sharp-linux-arm64": "0.33.1", + "@img/sharp-linux-s390x": "0.33.1", + "@img/sharp-linux-x64": "0.33.1", + "@img/sharp-linuxmusl-arm64": "0.33.1", + "@img/sharp-linuxmusl-x64": "0.33.1", + "@img/sharp-wasm32": "0.33.1", + "@img/sharp-win32-ia32": "0.33.1", + "@img/sharp-win32-x64": "0.33.1" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4815,6 +5326,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", diff --git a/package.json b/package.json index 858af60..e43945b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "react-chartjs-2": "^5.2.0", "react-dom": "^18", "react-timer-hook": "^3.0.7", + "sharp": "^0.33.1", "socket.io": "^4.7.2", "socket.io-client": "^4.7.2", "swr": "^2.2.4", diff --git a/tsconfig.json b/tsconfig.json index 66d7499..b093001 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,8 +23,8 @@ "@components/*": ["./components/*"], "@lib/*": ["./lib/*"], "@styles/*": ["/styles/*"], - "@santa/*": ["./images/santa/*"], - "@images/*": ["./images/*"], + "@santa/*": ["./assets/images/santa/*"], + "@images/*": ["./assets/images/*"], "@assets/*": ["./assets/*"], } },