From 92715bed431cace82a3470ef2825d297b99b9653 Mon Sep 17 00:00:00 2001 From: pphatdev Date: Fri, 6 Jun 2025 15:32:38 +0700 Subject: [PATCH 1/5] Refactor import paths to use relative paths for constants --- src/app/api/contact/route.ts | 2 +- src/app/contact/metadata.ts | 2 +- src/lib/meta/posts.ts | 2 +- src/lib/utils/og-image.ts | 2 +- src/scripts/test-structured-data.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/api/contact/route.ts b/src/app/api/contact/route.ts index 0339572..5ba2e23 100644 --- a/src/app/api/contact/route.ts +++ b/src/app/api/contact/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from 'next/server'; import { sendContactEmail } from '@lib/utils/email-service'; -import { CONTACT_EMAIL } from '@lib/constants'; +import { CONTACT_EMAIL } from '../../../lib/constants'; // Simple rate limiting for spam prevention const RATE_LIMIT_WINDOW = 60 * 1000; // 1 minute diff --git a/src/app/contact/metadata.ts b/src/app/contact/metadata.ts index 70f0f02..70264c3 100644 --- a/src/app/contact/metadata.ts +++ b/src/app/contact/metadata.ts @@ -1,5 +1,5 @@ import { Metadata } from "next"; -import { appName, NEXT_PUBLIC_APP_URL } from "@lib/constants"; +import { appName, NEXT_PUBLIC_APP_URL } from "../../lib/constants"; import { getOgImageMetadata } from "@lib/utils/og-image"; const contactDescription = "Get in touch with me. I'm always open to discussing new projects, creative ideas or opportunities to be part of your vision."; diff --git a/src/lib/meta/posts.ts b/src/lib/meta/posts.ts index d3bf01d..e46caf8 100644 --- a/src/lib/meta/posts.ts +++ b/src/lib/meta/posts.ts @@ -1,4 +1,4 @@ -import { appName, NEXT_PUBLIC_APP_URL } from "@lib/constants"; +import { appName, NEXT_PUBLIC_APP_URL } from "../../lib/constants"; import { icons } from "./icons"; import { keywords } from "./keywords"; import { Metadata } from "next"; diff --git a/src/lib/utils/og-image.ts b/src/lib/utils/og-image.ts index c7be5b3..dbf5853 100644 --- a/src/lib/utils/og-image.ts +++ b/src/lib/utils/og-image.ts @@ -2,7 +2,7 @@ * Utility functions for generating OpenGraph image URLs */ -import { NEXT_PUBLIC_APP_URL } from "@lib/constants"; +import { NEXT_PUBLIC_APP_URL } from "../../lib/constants"; type OgImageParams = { title?: string; diff --git a/src/scripts/test-structured-data.ts b/src/scripts/test-structured-data.ts index 79452d0..a9c4c92 100644 --- a/src/scripts/test-structured-data.ts +++ b/src/scripts/test-structured-data.ts @@ -63,7 +63,7 @@ components.forEach((component: string) => { const content: string = fs.readFileSync(componentPath, 'utf-8'); // Check if it imports from constants - if (content.includes('from "@lib/constants"') || content.includes('from \'@lib/constants\'')) { + if (content.includes('from "../lib/constants"') || content.includes('from \'../lib/constants\'')) { console.log(`\t${colors.green}✅ ${component} uses constants${colors.reset}`); } else { console.log(`\t${colors.red}❌ ${component} doesn't use constants${colors.reset}`); From da622005010c94556fcd8a6dac299af63bcc9838 Mon Sep 17 00:00:00 2001 From: pphatdev Date: Fri, 6 Jun 2025 15:32:43 +0700 Subject: [PATCH 2/5] Update structured data script to use JSON.stringify for better formatting --- src/components/home-person-structured-data.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/home-person-structured-data.tsx b/src/components/home-person-structured-data.tsx index 7bc61ac..9081867 100644 --- a/src/components/home-person-structured-data.tsx +++ b/src/components/home-person-structured-data.tsx @@ -95,7 +95,7 @@ export default function HomePersonStructuredData() {